mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-25 14:16:30 +01:00
Always call update_use_power() instead of directly setting the use_power var.
- This will let us react to the change appropriately. - While we're here, lets define some constants so we can stop using bare numbers. - Always use those constants when calling update_use_power()
This commit is contained in:
@@ -156,7 +156,7 @@
|
||||
idle_power_usage = 0
|
||||
for(var/obj/machinery/shield/shield_tile in deployed_shields)
|
||||
idle_power_usage += shield_tile.shield_idle_power
|
||||
update_use_power(1)
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
|
||||
/obj/machinery/shieldgen/proc/shields_down()
|
||||
if(!active) return 0 //If it's already off, how did this get called?
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
collapse_shields()
|
||||
|
||||
update_use_power(0)
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
/obj/machinery/shieldgen/proc/create_shields()
|
||||
for(var/turf/target_tile in range(2, src))
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
update_icon()
|
||||
return
|
||||
enabled = !enabled
|
||||
use_power = enabled + 1
|
||||
update_use_power(enabled ? USE_POWER_ACTIVE : USE_POWER_IDLE)
|
||||
update_icon()
|
||||
to_chat(usr, "You turn \the [src] [enabled ? "on" : "off"].")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user