Fix vending machines not updating their power when moved (#10714)

This commit is contained in:
Wildkins
2020-12-03 07:09:34 -05:00
committed by GitHub
parent 8f1fd0592f
commit cc87fe7a4f
2 changed files with 10 additions and 1 deletions

View File

@@ -318,6 +318,7 @@
if(!src) return
to_chat(user, "<span class='notice'>You [anchored? "un" : ""]secured \the [src]!</span>")
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("<span class='warning'>[src] launches [throw_item.name] at [target.name]!</span>")
return 1
return 1