mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-08 08:31:53 +00:00
Storage Exploit Fix (#17298)
* storage fix
* storage fix 2
* am i dumb?
* add message check
* Revert "am i dumb?"
This reverts commit 91f7f24968.
This commit is contained in:
@@ -164,6 +164,23 @@
|
||||
master.attackby(I, usr, params)
|
||||
return TRUE
|
||||
|
||||
/obj/screen/storage/proc/is_item_accessible(obj/item/I, mob/user)
|
||||
if (!user || !I)
|
||||
return FALSE
|
||||
|
||||
var/storage_depth = I.storage_depth(user)
|
||||
if((I in user.loc) || (storage_depth != -1))
|
||||
return TRUE
|
||||
|
||||
if(!isturf(user.loc))
|
||||
return FALSE
|
||||
|
||||
var/storage_depth_turf = I.storage_depth_turf()
|
||||
if(isturf(I.loc) || (storage_depth_turf != -1))
|
||||
if(I.Adjacent(user))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/screen/storage/MouseDrop_T(obj/item/I, mob/user)
|
||||
if(!user || !istype(I) || user.incapacitated(ignore_restraints = TRUE, ignore_lying = TRUE) || istype(user.loc, /obj/mecha) || !master)
|
||||
return
|
||||
@@ -172,6 +189,11 @@
|
||||
if(!S)
|
||||
return
|
||||
|
||||
if(!is_item_accessible(I, user))
|
||||
log_game("[user.simple_info_line()] tried to abuse storage remote drag&drop with '[I]' at [atom_loc_line(I)] into '[S]' at [atom_loc_line(S)]")
|
||||
message_admins("[user.simple_info_line()] tried to abuse storage remote drag&drop with '[I]' at [atom_loc_line(I)] into '[S]' at [atom_loc_line(S)]")
|
||||
return
|
||||
|
||||
if(I in S.contents) // If the item is already in the storage, move them to the end of the list
|
||||
if(S.contents[S.contents.len] == I) // No point moving them at the end if they're already there!
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user