diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 48fdf1bb1d..a5c2fc2f44 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -327,3 +327,9 @@ var/list/mob/living/forced_ambiance_list = new /area/proc/shuttle_departed() return TRUE + +/area/AllowDrop() + CRASH("Bad op: area/AllowDrop() called") + +/area/drop_location() + CRASH("Bad op: area/drop_location() called") diff --git a/code/game/atoms.dm b/code/game/atoms.dm index dba0ec67ab..c994aff121 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -502,3 +502,12 @@ if(A && A.has_gravity()) return TRUE return FALSE + +/atom/proc/drop_location() + var/atom/L = loc + if(!L) + return null + return L.AllowDrop() ? L : get_turf(L) + +/atom/proc/AllowDrop() + return FALSE diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index ca2d76d9f2..03ad104810 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -725,4 +725,7 @@ ..() if(open && contents.len) var/display_item = contents[1] - to_chat(user, "\The [src] contains \the [display_item]!") \ No newline at end of file + to_chat(user, "\The [src] contains \the [display_item]!") + +/obj/item/weapon/storage/AllowDrop() + return TRUE diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 7e922e97bb..e25553d361 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -415,3 +415,6 @@ /obj/structure/closet/onDropInto(var/atom/movable/AM) return + +/obj/structure/closet/AllowDrop() + return TRUE diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index d3abc04352..b2d87a4bb1 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -277,3 +277,6 @@ var/const/enterloopsanity = 100 if(isliving(AM)) var/mob/living/M = AM M.turf_collision(src, speed) + +/turf/AllowDrop() + return TRUE diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index a7f278cb6a..c655559a10 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -208,7 +208,7 @@ var/list/slot_equipment_priority = list( \ if(target) I.forceMove(target) else - I.dropInto(loc) + I.dropInto(drop_location()) I.dropped(src) return 1