From d962858116c5c6252166fae500c53fdfe25afd98 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Sun, 4 Feb 2018 22:08:17 -0600 Subject: [PATCH] Fixes smugglers satchels being able to refresh items forever (#35270) --- code/controllers/subsystem/persistence.dm | 4 +++- code/game/objects/items/storage/backpack.dm | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index b98be937fca3f..3973d9d281360 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -10,6 +10,7 @@ SUBSYSTEM_DEF(persistence) var/list/saved_messages = list() var/list/saved_modes = list(1,2,3) var/list/saved_trophies = list() + var/list/spawned_objects = list() /datum/controller/subsystem/persistence/Initialize() LoadSatchels() @@ -62,7 +63,8 @@ SUBSYSTEM_DEF(persistence) if(isfloorturf(F.loc) && !isplatingturf(F.loc)) F.hide(1) if(ispath(path)) - new path(F) + var/spawned_item = new path(F) + spawned_objects[spawned_item] = TRUE placed_satchel++ var/free_satchels = 0 for(var/turf/T in shuffle(block(locate(TRANSITIONEDGE,TRANSITIONEDGE,ZLEVEL_STATION_PRIMARY), locate(world.maxx-TRANSITIONEDGE,world.maxy-TRANSITIONEDGE,ZLEVEL_STATION_PRIMARY)))) //Nontrivially expensive but it's roundstart only diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index c1aa39ddb1a12..669146288836d 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -326,6 +326,12 @@ new R(src) revealed = 1 +/obj/item/storage/backpack/satchel/flat/can_be_inserted(obj/item/W, stop_messages = 0, mob/user) + if(SSpersistence.spawned_objects[W]) + to_chat(user, "[W] is unstable after its journey through space and time, it wouldn't survive another trip.") + return FALSE + return ..() + /obj/item/storage/backpack/duffelbag name = "duffel bag" desc = "A large duffel bag for holding extra things."