Removes weird arg in machinery get_room_area (#79645)

## About The Pull Request

This argument was only ever used as a pseudo dot operator. Not only that
but it was typed as `/area`, yet the only place that passed something to
it passed `/obj/machinery/light`s.

So I axed it.
This commit is contained in:
MrMelbert
2023-11-13 17:59:51 -07:00
committed by GitHub
parent 2257088876
commit f1863d9ae0
2 changed files with 26 additions and 21 deletions
+16 -11
View File
@@ -512,19 +512,24 @@
return TRUE
///Get a valid powered area to reference for power use, mainly for wall-mounted machinery that isn't always mapped directly in a powered location.
/obj/machinery/proc/get_room_area(area/machine_room)
/obj/machinery/proc/get_room_area()
var/area/machine_area = get_area(src)
if(!machine_area.always_unpowered) ///check our loc first to see if its a powered area
machine_room = machine_area
return machine_room
var/turf/mounted_wall = get_step(src,dir)
if (mounted_wall && istype(mounted_wall, /turf/closed))
if(isnull(machine_area))
return null // ??
// check our own loc first to see if its a powered area
if(!machine_area.always_unpowered)
return machine_area
// loc area wasn't good, checking adjacent wall for a good area to use
var/turf/mounted_wall = get_step(src, dir)
if(isclosedturf(mounted_wall))
var/area/wall_area = get_area(mounted_wall)
if(!wall_area.always_unpowered) //loc area wasn't good, checking adjacent wall for a good area to use
machine_room = wall_area
return machine_room
machine_room = machine_area ///couldn't find a proper powered area on loc or adjacent wall, defaulting back to loc and blaming mappers
return machine_room
if(!wall_area.always_unpowered)
return wall_area
// couldn't find a proper powered area on loc or adjacent wall, defaulting back to loc and blaming mappers
return machine_area
///makes this machine draw power from its area according to which use_power mode it is set to
/obj/machinery/proc/update_current_power_usage()
+10 -10
View File
@@ -101,7 +101,7 @@
qdel(on_turf)
if(!mapload) //sync up nightshift lighting for player made lights
var/area/our_area = get_room_area(src)
var/area/our_area = get_room_area()
var/obj/machinery/power/apc/temp_apc = our_area.apc
nightshift_enabled = temp_apc?.nightshift_lights
@@ -131,7 +131,7 @@
update(trigger = FALSE)
/obj/machinery/light/Destroy()
var/area/local_area = get_room_area(src)
var/area/local_area = get_room_area()
if(local_area)
on = FALSE
QDEL_NULL(cell)
@@ -154,7 +154,7 @@
/obj/machinery/light/update_icon_state()
switch(status) // set icon_states
if(LIGHT_OK)
var/area/local_area =get_room_area(src)
var/area/local_area = get_room_area()
if(low_power_mode || major_emergency || (local_area?.fire))
icon_state = "[base_state]_emergency"
else
@@ -174,7 +174,7 @@
. += emissive_appearance(overlay_icon, "[base_state]", src, alpha = src.alpha)
var/area/local_area = get_room_area(src)
var/area/local_area = get_room_area()
if(low_power_mode || major_emergency || (local_area?.fire))
. += mutable_appearance(overlay_icon, "[base_state]_emergency")
@@ -190,7 +190,7 @@
. = ..()
if(!.)
return
var/area/our_area = get_room_area(src)
var/area/our_area = get_room_area()
RegisterSignal(our_area, COMSIG_AREA_FIRE_CHANGED, PROC_REF(handle_fire))
/obj/machinery/light/on_enter_area(datum/source, area/area_to_register)
@@ -220,7 +220,7 @@
color_set = color
if(reagents)
START_PROCESSING(SSmachines, src)
var/area/local_area =get_room_area(src)
var/area/local_area = get_room_area()
if (local_area?.fire)
color_set = fire_colour
brightness_set = fire_brightness
@@ -262,7 +262,7 @@
static_power_used = 0
else if(on) //Light is on, just recalculate usage
var/static_power_used_new = 0
var/area/local_area = get_room_area(src)
var/area/local_area = get_room_area()
if (nightshift_enabled && !local_area?.fire)
static_power_used_new = nightshift_brightness * nightshift_light_power * power_consumption_rate
else
@@ -447,13 +447,13 @@
// returns if the light has power /but/ is manually turned off
// if a light is turned off, it won't activate emergency power
/obj/machinery/light/proc/turned_off()
var/area/local_area = get_room_area(src)
var/area/local_area = get_room_area()
return !local_area.lightswitch && local_area.power_light || flickering
// returns whether this light has power
// true if area has power and lightswitch is on
/obj/machinery/light/proc/has_power()
var/area/local_area =get_room_area(src)
var/area/local_area = get_room_area()
return local_area.lightswitch && local_area.power_light
// returns whether this light has emergency power
@@ -655,7 +655,7 @@
// called when area power state changes
/obj/machinery/light/power_change()
SHOULD_CALL_PARENT(FALSE)
var/area/local_area =get_room_area(src)
var/area/local_area = get_room_area()
set_on(local_area.lightswitch && local_area.power_light)
// called when heated