From 48d9e2e34969acc90591e9ce0af273ade344bd82 Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Sun, 7 May 2017 22:24:26 -0700 Subject: [PATCH] fixes rejects --- code/controllers/subsystem/persistence.dm | 3 + code/controllers/subsystem/persistence.dm.rej | 11 - code/game/objects/structures/displaycase.dm | 202 +++++++++--------- .../objects/structures/displaycase.dm.rej | 10 - 4 files changed, 104 insertions(+), 122 deletions(-) delete mode 100644 code/controllers/subsystem/persistence.dm.rej delete mode 100644 code/game/objects/structures/displaycase.dm.rej diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index 6b3e47054c..c42dfc38e2 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -114,6 +114,9 @@ SUBSYSTEM_DEF(persistence) var/saved_json trophy_sav >> saved_json + if(!saved_json) + return + var/decoded_json = json_decode(saved_json) if(!islist(decoded_json)) diff --git a/code/controllers/subsystem/persistence.dm.rej b/code/controllers/subsystem/persistence.dm.rej deleted file mode 100644 index 5c575b2068..0000000000 --- a/code/controllers/subsystem/persistence.dm.rej +++ /dev/null @@ -1,11 +0,0 @@ -diff a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm (rejected hunks) -@@ -114,6 +114,9 @@ SUBSYSTEM_DEF(persistence) - var/saved_json - trophy_sav >> saved_json - -+ if(!saved_json) -+ return -+ - var/decoded_json = json_decode(saved_json) - - if(!islist(decoded_json)) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 3817a16685..e25afcce81 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -16,25 +16,25 @@ var/obj/item/weapon/electronics/airlock/electronics var/start_showpiece_type = null //add type for items on display -/obj/structure/displaycase/Initialize() - . = ..() +/obj/structure/displaycase/Initialize() + . = ..() if(start_showpiece_type) showpiece = new start_showpiece_type (src) update_icon() /obj/structure/displaycase/Destroy() if(electronics) - QDEL_NULL(electronics) + QDEL_NULL(electronics) if(showpiece) - QDEL_NULL(showpiece) + QDEL_NULL(showpiece) return ..() /obj/structure/displaycase/examine(mob/user) ..() if(alert) to_chat(user, "Hooked up with an anti-theft system.") - if(showpiece) - to_chat(user, "There's [showpiece] inside.") + if(showpiece) + to_chat(user, "There's [showpiece] inside.") /obj/structure/displaycase/proc/dump() @@ -82,7 +82,7 @@ getFlatIcon(A,defdir=4) catch return 0 - return 1 + return TRUE /obj/structure/displaycase/proc/get_flat_icon_directional(atom/A) //Get flatIcon even if dir is mismatched for directionless icons @@ -175,7 +175,7 @@ user.changeNext_move(CLICK_CD_MELEE) if (showpiece && (broken || open)) to_chat(user, "You deactivate the hover field built into the case.") - dump() + dump() src.add_fingerprint(user) update_icon() return @@ -247,96 +247,96 @@ desc = "A glass lab container for storing interesting creatures." start_showpiece_type = /obj/item/clothing/mask/facehugger/lamarr req_access = list(GLOB.access_rd) - - - -/obj/structure/displaycase/trophy - name = "trophy display case" - desc = "Store your trophies of accomplishment in here, and they will stay forever." - var/trophy_message = "" - var/placer_key = "" - var/added_roundstart = TRUE - alert = TRUE - integrity_failure = 0 - -/obj/structure/displaycase/trophy/Initialize() - . = ..() - GLOB.trophy_cases += src - -/obj/structure/displaycase/trophy/Destroy() - GLOB.trophy_cases -= src - return ..() - -/obj/structure/displaycase/trophy/examine(mob/user) - ..() - if(trophy_message) - to_chat(user, "The plaque reads:") - to_chat(user, trophy_message) - -/obj/structure/displaycase/trophy/attackby(obj/item/weapon/W, mob/user, params) - - if(!user.Adjacent(src)) //no TK museology - return - - if(!added_roundstart) - to_chat(user, "You've already put something new in this case.") - return - - if(is_type_in_typecache(W, GLOB.blacklisted_cargo_types)) - to_chat(user, "The case rejects the [W].") - return - - for(var/a in W.GetAllContents()) - if(is_type_in_typecache(a, GLOB.blacklisted_cargo_types)) - to_chat(user, "The case rejects the [W].") - return - - if(user.drop_item()) - - if(showpiece) - to_chat(user, "You press a button, and [showpiece] descends into the floor of the case.") - QDEL_NULL(showpiece) - - to_chat(user, "You insert [W] into the case.") - W.forceMove(src) - showpiece = W - added_roundstart = FALSE - update_icon() - - placer_key = user.ckey - - trophy_message = W.desc //default value - - var/chosen_plaque = stripped_input(user, "What would you like the plaque to say? Default value is item's description.", "Trophy Plaque") - if(chosen_plaque) - if(user.Adjacent(src)) - trophy_message = chosen_plaque - to_chat(user, "You set the plaque's text.") - else - to_chat(user, "You are too far to set the plaque's text.") - - SSpersistence.SaveTrophy(src) - - else - to_chat(user, "\The [W] is stuck to your hand, you can't put it in the [src.name]!") - - return - -/obj/structure/displaycase/trophy/dump() - if (showpiece) - if(added_roundstart) - visible_message("The [showpiece] crumbles to dust!") - new /obj/effect/decal/cleanable/ash(loc) - QDEL_NULL(showpiece) - else - ..() - -/obj/item/showpiece_dummy - name = "Cheap replica" - -/obj/item/showpiece_dummy/Initialize(mapload, path) - . = ..() - var/obj/item/I = path - name = initial(I.name) - icon = initial(I.icon) - icon_state = initial(I.icon_state) + + + +/obj/structure/displaycase/trophy + name = "trophy display case" + desc = "Store your trophies of accomplishment in here, and they will stay forever." + var/trophy_message = "" + var/placer_key = "" + var/added_roundstart = TRUE + alert = TRUE + integrity_failure = 0 + +/obj/structure/displaycase/trophy/Initialize() + . = ..() + GLOB.trophy_cases += src + +/obj/structure/displaycase/trophy/Destroy() + GLOB.trophy_cases -= src + return ..() + +/obj/structure/displaycase/trophy/examine(mob/user) + ..() + if(trophy_message) + to_chat(user, "The plaque reads:") + to_chat(user, trophy_message) + +/obj/structure/displaycase/trophy/attackby(obj/item/weapon/W, mob/user, params) + + if(!user.Adjacent(src)) //no TK museology + return + + if(!added_roundstart) + to_chat(user, "You've already put something new in this case.") + return + + if(is_type_in_typecache(W, GLOB.blacklisted_cargo_types)) + to_chat(user, "The case rejects the [W].") + return + + for(var/a in W.GetAllContents()) + if(is_type_in_typecache(a, GLOB.blacklisted_cargo_types)) + to_chat(user, "The case rejects the [W].") + return + + if(user.drop_item()) + + if(showpiece) + to_chat(user, "You press a button, and [showpiece] descends into the floor of the case.") + QDEL_NULL(showpiece) + + to_chat(user, "You insert [W] into the case.") + W.forceMove(src) + showpiece = W + added_roundstart = FALSE + update_icon() + + placer_key = user.ckey + + trophy_message = W.desc //default value + + var/chosen_plaque = stripped_input(user, "What would you like the plaque to say? Default value is item's description.", "Trophy Plaque") + if(chosen_plaque) + if(user.Adjacent(src)) + trophy_message = chosen_plaque + to_chat(user, "You set the plaque's text.") + else + to_chat(user, "You are too far to set the plaque's text.") + + SSpersistence.SaveTrophy(src) + + else + to_chat(user, "\The [W] is stuck to your hand, you can't put it in the [src.name]!") + + return + +/obj/structure/displaycase/trophy/dump() + if (showpiece) + if(added_roundstart) + visible_message("The [showpiece] crumbles to dust!") + new /obj/effect/decal/cleanable/ash(loc) + QDEL_NULL(showpiece) + else + ..() + +/obj/item/showpiece_dummy + name = "Cheap replica" + +/obj/item/showpiece_dummy/Initialize(mapload, path) + . = ..() + var/obj/item/I = path + name = initial(I.name) + icon = initial(I.icon) + icon_state = initial(I.icon_state) diff --git a/code/game/objects/structures/displaycase.dm.rej b/code/game/objects/structures/displaycase.dm.rej deleted file mode 100644 index ee677c1b9d..0000000000 --- a/code/game/objects/structures/displaycase.dm.rej +++ /dev/null @@ -1,10 +0,0 @@ -diff a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm (rejected hunks) -@@ -316,7 +316,7 @@ - to_chat(user, "You are too far to set the plaque's text.") - - SSpersistence.SaveTrophy(src) -- return 1 -+ return TRUE - - else - to_chat(user, "\The [W] is stuck to your hand, you can't put it in the [src.name]!")