From 48056f8a7687d9ce79db297ff7584691e9d7bc09 Mon Sep 17 00:00:00 2001 From: Fira Date: Tue, 7 Nov 2023 20:50:49 +0000 Subject: [PATCH] review --- code/datums/components/crate_tag.dm | 1 + code/modules/cm_tech/droppod/supply.dm | 7 +++-- code/modules/recycling/sortingmachinery.dm | 36 +++++++++++----------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/code/datums/components/crate_tag.dm b/code/datums/components/crate_tag.dm index a628099a3a4c..379df82a2084 100644 --- a/code/datums/components/crate_tag.dm +++ b/code/datums/components/crate_tag.dm @@ -29,6 +29,7 @@ parent.AddComponent(/datum/component/label, name) src.name = name // Keep it around additionally for notifications +/// Handler to notify an overwatched squad that this crate has been dropped for them /datum/component/crate_tag/proc/notify_squad(datum/source, datum/squad/squad) SIGNAL_HANDLER squad.send_message("'[name]' supply drop incoming. Heads up!") diff --git a/code/modules/cm_tech/droppod/supply.dm b/code/modules/cm_tech/droppod/supply.dm index bfe6ca36316d..1da7d8d7b66f 100644 --- a/code/modules/cm_tech/droppod/supply.dm +++ b/code/modules/cm_tech/droppod/supply.dm @@ -3,18 +3,19 @@ drop_time = 10 SECONDS dropping_time = 2 SECONDS open_time = 2 SECONDS + /// The contained parimary object, used as a replacer for the droppod icon var/obj/structure/package -/obj/structure/droppod/supply/Initialize(mapload, obj/structure/closet/crate/package) +/obj/structure/droppod/supply/Initialize(mapload, obj/structure/package) . = ..() if(!istype(package)) return INITIALIZE_HINT_QDEL package.forceMove(src) src.package = package -/obj/structure/droppod/supply/Destroy() - . = ..() +/obj/structure/droppod/supply/Destroy(force) package = null + return ..() /* Pose as the crate so we see it falling from the skies */ /obj/structure/droppod/supply/update_icon() diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index da7b0a51d40e..3ec5ab53fd45 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -282,36 +282,36 @@ if(!chosen_type || !ispath(crate.crate_customizing_types[chosen_type]) || !user.Adjacent(target) || !target.z) return target.AddComponent(/datum/component/crate_tag, label, crate.crate_customizing_types[chosen_type]) - src.amount -= 3 + amount -= 3 else - if (src.amount > 3 && !crate.opened) - var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(crate.loc)) - P.icon_state = "deliverycrate" - P.wrapped = crate - crate.forceMove(P) - src.amount -= 3 + if (amount > 3 && !crate.opened) + var/obj/structure/bigDelivery/package = new /obj/structure/bigDelivery(get_turf(crate.loc)) + package.icon_state = "deliverycrate" + package.wrapped = crate + crate.forceMove(package) + amount -= 3 user.visible_message("\The [user] wraps \a [target] with \a [src].",\ SPAN_NOTICE("You wrap \the [target], leaving [amount] units of paper on \the [src]."),\ "You hear someone taping paper around a large object.") - else if(src.amount < 3) + else if(amount < 3) to_chat(user, SPAN_WARNING("You need more paper.")) else if (istype (target, /obj/structure/closet)) - var/obj/structure/closet/O = target - if (src.amount > 3 && !O.opened) - var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc)) - P.wrapped = O - O.welded = 1 - O.forceMove(P) - src.amount -= 3 + var/obj/structure/closet/object = target + if (amount > 3 && !object.opened) + var/obj/structure/bigDelivery/package = new /obj/structure/bigDelivery(get_turf(object.loc)) + package.wrapped = object + object.welded = 1 + object.forceMove(package) + amount -= 3 user.visible_message("\The [user] wraps \a [target] with \a [src].",\ SPAN_NOTICE("You wrap \the [target], leaving [amount] units of paper on \the [src]."),\ "You hear someone taping paper around a large object.") - else if(src.amount < 3) + else if(amount < 3) to_chat(user, SPAN_WARNING("You need more paper.")) else to_chat(user, SPAN_NOTICE(" The object you are trying to wrap is unsuitable for the sorting machinery!")) - if (src.amount <= 0) - new /obj/item/trash/c_tube( src.loc ) + if (amount <= 0) + new /obj/item/trash/c_tube( loc ) qdel(src) return return