mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user