mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-15 20:52:07 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user