Moves get_area to a macro (#24712)

* Moves get_area to a macro

* fixes

* Update code/game/machinery/camera/camera.dm

Co-authored-by: Charlie Nolan <funnyman3595@gmail.com>

* runtime fix

* moer fix

---------

Co-authored-by: Charlie Nolan <funnyman3595@gmail.com>
This commit is contained in:
GDN
2024-04-08 21:42:22 +00:00
committed by GitHub
co-authored by Charlie Nolan
parent 744d9c6bed
commit b6be540b43
18 changed files with 72 additions and 60 deletions
@@ -245,9 +245,9 @@
underlays += emissive_appearance(icon, "intercom_lightmask")
/obj/item/radio/intercom/proc/update_operating_status(on = TRUE)
var/area/current_area = get_area(src)
if(!current_area)
if(!loc) // We init a few radios in nullspace to prevent them from needing power.
return
var/area/current_area = get_area(src)
if(on)
RegisterSignal(current_area.powernet, COMSIG_POWERNET_POWER_CHANGE, PROC_REF(local_powernet_check))
else
@@ -266,7 +266,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
connection = radio_connection
channel = null
if(is_type_in_list(get_area(src), blacklisted_areas))
if(loc && is_type_in_list(get_area(src), blacklisted_areas))
// add a debug log so people testing things won't be fighting against a "broken" radio for too long.
log_debug("Radio message from [src] was used in restricted area [get_area(src)].")
return