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 ba9b3d35a3
commit 93fb3f7865
16 changed files with 38 additions and 27 deletions

View File

@@ -20,9 +20,9 @@
/obj/machinery/proc/change_power_consumption(new_power_consumption, use_power_mode = USE_POWER_IDLE)
switch(use_power_mode)
if(USE_POWER_IDLE)
idle_power_usage = new_power_consumption
update_idle_power_usage(new_power_consumption)
if(USE_POWER_ACTIVE)
active_power_usage = new_power_consumption
update_active_power_usage(new_power_consumption)
// No need to do anything else in our power scheme.
// Defining directly here to avoid conflicts with existing set_broken procs in our codebase that behave differently.