adds safety logging for quick equip baguloosing (#36710)

* adds safety logging

* puts it here

* now works

* more sanity

* makes it inherit

* cleaner
This commit is contained in:
SECBATON GRIFFON
2024-08-31 19:03:25 +01:00
committed by GitHub
parent 2aa84d3d21
commit efcbff25a2
5 changed files with 17 additions and 0 deletions

View File

@@ -501,6 +501,7 @@ var/global/msg_id = 0
(istype(I,/obj/item/weapon/spacecash) && id && id.virtual_wallet)
/obj/item/device/pda/quick_store(var/obj/item/I,mob/user)
..()
return !(attackby(I,user))
/obj/item/device/pda/proc/add_to_virtual_wallet(var/amount, var/mob/user, var/atom/giver)

View File

@@ -32,6 +32,15 @@
user.drop_item(src)
qdel(user)
/obj/item/weapon/storage/backpack/holding/quick_store(var/obj/item/I,mob/user)
if(user?.client)
var/list/recursive_list = recursive_type_check(I, /obj/item/weapon/storage/backpack/holding)
if(recursive_list.len)
var/report = " created a baguloose from quick equipping in [(world.time - user.client.last_quick_stored) / 10] seconds, might be worth noting."
message_admins("[key_name_admin(user)][report]") // any info about the baguloose is shown below anyways
log_game("[key_name(user)][report]")
return ..()
/obj/item/weapon/storage/backpack/holding/handle_item_insertion(obj/item/W, prevent_warning)
. = ..()
if(W == src)

View File

@@ -421,6 +421,7 @@
return can_be_inserted(I,1)
/obj/item/weapon/storage/quick_store(var/obj/item/I,mob/user)
..()
return handle_item_insertion(I,0)
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target

View File

@@ -680,7 +680,12 @@ a {
/obj/proc/can_quick_store(var/obj/item/I) //proc used to check that the current object can store another through quick equip
return 0
/client
var/last_quick_stored = 0
/obj/proc/quick_store(var/obj/item/I,mob/user) //proc used to handle quick storing
if(user?.client)
user.client.last_quick_stored = world.time
return 0
/**

View File

@@ -138,6 +138,7 @@
return 1
/obj/item/clothing/quick_store(var/obj/item/I,mob/user)
..()
for(var/obj/item/clothing/accessory/storage/A in accessories)
if(A.hold && A.hold.handle_item_insertion(I,0))
return 1