Call update procs instead of directly setting idle_power_usage or active_power_usage.

- Adds the update_idle_power_usage() and update_active_power_usage() procs for the respective vars.
- Switches all places modifying those vars directly to call the procs instead.
- This will let us react to the change appropriately, paving the way towards static area power.
- Adds update_power_channel proc for the sake of completeness, but no machines actually modify it so far.
This commit is contained in:
Leshana
2020-04-21 12:48:13 -04:00
parent 5a92fc4ec9
commit 66b40b2c71
16 changed files with 38 additions and 27 deletions

View File

@@ -153,9 +153,10 @@
create_shields()
idle_power_usage = 0
var/new_power_usage = 0
for(var/obj/machinery/shield/shield_tile in deployed_shields)
idle_power_usage += shield_tile.shield_idle_power
new_power_usage += shield_tile.shield_idle_power
update_idle_power_usage(new_power_usage)
update_use_power(USE_POWER_IDLE)
/obj/machinery/shieldgen/proc/shields_down()
@@ -205,7 +206,7 @@
new_power_usage += shield_tile.shield_idle_power
if (new_power_usage != idle_power_usage)
idle_power_usage = new_power_usage
update_idle_power_usage(new_power_usage)
use_power(0)
check_delay = 60