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
+4 -2
View File
@@ -233,7 +233,8 @@
for(var/mob/living/simple_animal/bot/B in bots)
botsCount++
if(B.loc)
botsData[++botsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(get_area(B).name), "uid" = "[B.UID()]")
var/area/our_area = get_area(B)
botsData[++botsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(our_area.name), "uid" = "[B.UID()]")
if(!length(botsData))
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
@@ -309,7 +310,8 @@
for(var/mob/living/simple_animal/bot/mulebot/B in GLOB.bots_list)
mulebotsCount++
if(B.loc)
mulebotsData[++mulebotsData.len] = list("Name" = sanitize(B.name), "Location" = get_area(B).name, "uid" = "[B.UID()]")
var/area/our_area = get_area(B)
mulebotsData[++mulebotsData.len] = list("Name" = sanitize(B.name), "Location" = our_area.name, "uid" = "[B.UID()]")
if(!mulebotsData.len)
mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)