From cc87fe7a4f7dd711f9f1a51a4cd20ef503b2acbd Mon Sep 17 00:00:00 2001 From: Wildkins Date: Thu, 3 Dec 2020 07:09:34 -0500 Subject: [PATCH] Fix vending machines not updating their power when moved (#10714) --- code/game/machinery/vending.dm | 5 ++++- html/changelogs/johnwildkins-vendpower.yml | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/johnwildkins-vendpower.yml diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index a04759fae47..b9c42aefb61 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -318,6 +318,7 @@ if(!src) return to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") anchored = !anchored + power_change() return else if(istype(W,/obj/item/vending_refill)) @@ -779,6 +780,8 @@ /obj/machinery/vending/power_change() ..() + if(!anchored) + stat |= NOPOWER if(stat & BROKEN) icon_state = "[initial(icon_state)]-broken" cut_overlays() @@ -833,4 +836,4 @@ spawn(0) throw_item.throw_at(target, 16, 3, src) src.visible_message("[src] launches [throw_item.name] at [target.name]!") - return 1 \ No newline at end of file + return 1 diff --git a/html/changelogs/johnwildkins-vendpower.yml b/html/changelogs/johnwildkins-vendpower.yml new file mode 100644 index 00000000000..ecbf4623a22 --- /dev/null +++ b/html/changelogs/johnwildkins-vendpower.yml @@ -0,0 +1,6 @@ +author: JohnWildkins + +delete-after: True + +changes: + - bugfix: "Unanchoring and moving vending machines should now properly update their powered status."