Skip to content

Commit b743c82

Browse files
Signals update to power_change() (#21421)
As title. Makes area/power_change() and area on_enter/on_exit procs both rely on signals for machinery handling where they draw power from.
1 parent 51f688c commit b743c82

38 files changed

+150
-50
lines changed

code/game/area/area_power.dm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
/area/proc/power_change()
2727
SEND_SIGNAL(src, COMSIG_AREA_POWER_CHANGE)
2828

29-
//One day, this will only use the signal, but that day is not today
30-
for(var/obj/machinery/M in src) // for each machine in the area
31-
M.power_change() // reverify power status (to update icons etc.)
32-
if (fire || eject || party)
33-
update_icon()
34-
3529
/area/proc/usage(var/chan)
3630
switch(chan)
3731
if(AREA_USAGE_LIGHT)

code/game/machinery/alarm.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ pixel_x = 10;
404404
return ..()
405405

406406
/obj/machinery/alarm/LateInitialize()
407+
. = ..()
407408
apply_mode()
408409

409410
/obj/machinery/alarm/Initialize(mapload, var/dir, var/building = 0)

code/game/machinery/atmoalter/portable_atmospherics.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
return INITIALIZE_HINT_LATELOAD
3535

3636
/obj/machinery/portable_atmospherics/canister/LateInitialize()
37+
. = ..()
3738
update_icon()
3839

3940
/obj/machinery/portable_atmospherics/process()

code/game/machinery/autolathe/autolathe.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
return INITIALIZE_HINT_LATELOAD
5757

5858
/obj/machinery/autolathe/LateInitialize()
59+
. = ..()
5960
populate_lathe_recipes()
6061

6162
/obj/machinery/autolathe/Destroy()

code/game/machinery/bluespace_drive.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
return INITIALIZE_HINT_LATELOAD
114114

115115
/obj/machinery/bluespacedrive/LateInitialize()
116+
. = ..()
116117
if(SSatlas.current_map.use_overmap && !linked)
117118
var/my_sector = GLOB.map_sectors["[z]"]
118119
if(istype(my_sector, /obj/effect/overmap/visitable/ship))
@@ -496,6 +497,7 @@
496497
return INITIALIZE_HINT_LATELOAD
497498

498499
/obj/machinery/computer/bluespacedrive/LateInitialize()
500+
. = ..()
499501

500502
linked_bluespace_drive = locate() in get_area(src)
501503

code/game/machinery/computer/pod.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
. = INITIALIZE_HINT_LATELOAD
2020

2121
/obj/machinery/computer/pod/LateInitialize()
22+
. = ..()
2223
for(var/obj/machinery/mass_driver/M in SSmachinery.machinery)
2324
if(M.id == id)
2425
connected = M

code/game/machinery/distress_button.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
return INITIALIZE_HINT_LATELOAD
1010

1111
/obj/machinery/button/distress/LateInitialize()
12+
. = ..()
1213
if(SSatlas.current_map.use_overmap && !linked)
1314
var/my_sector = GLOB.map_sectors["[z]"]
1415
if (istype(my_sector, /obj/effect/overmap/visitable))

code/game/machinery/doors/brigdoors.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
return INITIALIZE_HINT_LATELOAD
3737

3838
/obj/machinery/door_timer/LateInitialize()
39+
. = ..()
3940
for(var/obj/machinery/door/airlock/glass_security/D in SSmachinery.machinery)
4041
if(D.id_tag == src.id) // Airlocks use "id_tag" instead of "id".
4142
targets += D

code/game/machinery/firealarm.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
var/seclevel
1919
///looping sound datum for our fire alarm siren.
2020
var/datum/looping_sound/firealarm/soundloop
21+
always_area_sensitive = TRUE
2122

2223
/obj/machinery/firealarm/Initialize(mapload, var/dir, var/building = 0)
2324
. = ..(mapload)

code/game/machinery/machinery.dm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ Class Procs:
149149
*/
150150
var/manufacturer = null
151151

152+
///Do we want to hook into on_enter_area and on_exit_area?
153+
///Disables some optimizations
154+
var/always_area_sensitive = FALSE
155+
152156
/obj/machinery/feedback_hints(mob/user, distance, is_adjacent)
153157
. = list()
154158
if(signaler && is_adjacent)
@@ -190,6 +194,8 @@ Class Procs:
190194
if(component_parts.len)
191195
RefreshParts()
192196

197+
return INITIALIZE_HINT_LATELOAD
198+
193199
/obj/machinery/Destroy()
194200
//Stupid macro used in power usage
195201
CAN_BE_REDEFINED(TRUE)

0 commit comments

Comments
 (0)