Skip to content

Commit ba4f0da

Browse files
Minor refactor to area start_lit.
1 parent d054782 commit ba4f0da

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

code/game/area/area_abstract.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/area/hallway
22
name = "hallway"
33
holomap_color = HOLOMAP_AREACOLOR_HALLWAYS
4-
start_lit = TRUE
4+
area_start_lit = TRUE
55

66
/area/maintenance
77
area_flags = AREA_FLAG_RAD_SHIELDED

code/game/area/areas.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var/global/list/areas = list()
1414
mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
1515

1616
// If true, this area will force light switches on during init.
17-
var/start_lit = FALSE
17+
var/area_start_lit = null
1818

1919
// If true, will allow natural walls in this area to have xenoarchaeology finds in them.
2020
var/allow_xenoarchaeology_finds = TRUE

code/modules/lights/light_switch.dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242

4343
/obj/machinery/light_switch/LateInitialize()
4444
. = ..()
45+
4546
if(isnull(on))
46-
on = get_config_value(/decl/config/toggle/lights_start_on)
47-
if(!on)
48-
var/area/area = get_area(src)
49-
if(area?.start_lit)
50-
on = TRUE
47+
if(isnull(connected_area?.area_start_lit))
48+
on = get_config_value(/decl/config/toggle/lights_start_on)
49+
else
50+
on = connected_area.lightswitch
5151

5252
connected_area?.set_lightswitch(on)
5353
update_icon()

0 commit comments

Comments
 (0)