Replaces cached get_area vars for names (#34338)

This commit is contained in:
ShizCalev
2018-01-13 21:55:47 -05:00
committed by CitadelStationBot
parent 3a2ac4d102
commit 80095fea0a
21 changed files with 29 additions and 53 deletions
@@ -169,9 +169,8 @@
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir == 1 ? -24 : 24) : 0
var/area/A = get_area(src)
if(name == initial(name))
name = "[A.name] Air Alarm"
name = "[get_area_name(src)] Air Alarm"
update_icon()
@@ -624,10 +623,8 @@
if(!frequency)
return
var/area/A = get_area(src)
var/datum/signal/alert_signal = new(list(
"zone" = A.name,
"zone" = get_area_name(src),
"type" = "Atmospheric"
))
if(alert_level==2)
+1 -2
View File
@@ -21,9 +21,8 @@
var/turf/T = find_safe_turf(zlevels=zlevels)
if(T)
var/area/A = get_area(T)
user.forceMove(T)
to_chat(user, "<span class='notice'>You blink and find yourself in [A.name].</span>")
to_chat(user, "<span class='notice'>You blink and find yourself in [get_area_name(T)].</span>")
else
to_chat(user, "Nothing happens. You feel that this is a bad sign.")
if("No")
+1 -2
View File
@@ -264,7 +264,6 @@
if(!results.len)
return
var/atom/movable/AM = pick_n_take(results)
var/area/loot_area = get_area(AM)
say("Located: [AM.name] at [loot_area.name]")
say("Located: [AM.name] at [get_area_name(AM)]")
#undef LOOT_LOCATOR_COOLDOWN
+1 -2
View File
@@ -1070,8 +1070,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list(
target.set_screwyhud(SCREWYHUD_DEAD)
target.Knockdown(300)
target.silent += 10
var/area/area = get_area(target)
to_chat(target, "<span class='deadsay'><b>[target.mind.name]</b> has died at <b>[area.name]</b>.</span>")
to_chat(target, "<span class='deadsay'><b>[target.mind.name]</b> has died at <b>[get_area_name(target)]</b>.</span>")
if(prob(50))
var/mob/fakemob
var/list/dead_people = list()
+1 -2
View File
@@ -159,8 +159,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
/obj/structure/extraction_point/Initialize()
. = ..()
var/area/area_name = get_area(src)
name += " ([rand(100,999)]) ([area_name.name])"
name += " ([rand(100,999)]) ([get_area_name(src, TRUE)])"
GLOB.total_extraction_beacons += src
/obj/structure/extraction_point/Destroy()
@@ -260,8 +260,7 @@
var/list/L = list()
// HTML colors need a # prefix
L["htmlcolor"] = "#[body.dna.features["mcolor"]]"
var/area/A = get_area(body)
L["area"] = A.name
L["area"] = get_area_name(body, TRUE)
var/stat = "error"
switch(body.stat)
if(CONSCIOUS)
+1 -2
View File
@@ -49,11 +49,10 @@
timeofdeath = world.time
tod = worldtime2text()
var/turf/T = get_turf(src)
var/area/A = get_area(T)
for(var/obj/item/I in contents)
I.on_mob_death(src, gibbed)
if(mind && mind.name && mind.active && (!(T.flags_1 & NO_DEATHRATTLE_1)))
var/rendered = "<span class='deadsay'><b>[mind.name]</b> has died at <b>[A.name]</b>.</span>"
var/rendered = "<span class='deadsay'><b>[mind.name]</b> has died at <b>[get_area_name(T)]</b>.</span>"
deadchat_broadcast(rendered, follow_target = src, turf_target = T, message_type=DEADCHAT_DEATHRATTLE)
if(mind)
mind.store_memory("Time of death: [tod]", 0)
+2 -6
View File
@@ -243,9 +243,7 @@
if(!stat)
stat(null, text("System integrity: [(health+100)/2]%"))
stat(null, text("Connected cyborgs: [connected_robots.len]"))
var/area/borg_area
for(var/mob/living/silicon/robot/R in connected_robots)
borg_area = get_area(R)
var/robot_status = "Nominal"
if(R.shell)
robot_status = "AI SHELL"
@@ -255,7 +253,7 @@
robot_status = "DEPOWERED"
//Name, Health, Battery, Module, Area, and Status! Everything an AI wants to know about its borgies!
stat(null, text("[R.name] | S.Integrity: [R.health]% | Cell: [R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "Empty"] | \
Module: [R.designation] | Loc: [borg_area.name] | Status: [robot_status]"))
Module: [R.designation] | Loc: [get_area_name(R, TRUE)] | Status: [robot_status]"))
stat(null, text("AI shell beacons detected: [LAZYLEN(GLOB.available_ai_shells)]")) //Count of total AI shells
else
stat(null, text("Systems nonfunctional"))
@@ -456,18 +454,16 @@
var/turf/ai_current_turf = get_turf(src)
var/ai_Zlevel = ai_current_turf.z
var/d
var/area/bot_area
d += "<A HREF=?src=[REF(src)];botrefresh=1>Query network status</A><br>"
d += "<table width='100%'><tr><td width='40%'><h3>Name</h3></td><td width='30%'><h3>Status</h3></td><td width='30%'><h3>Location</h3></td><td width='10%'><h3>Control</h3></td></tr>"
for (Bot in GLOB.alive_mob_list)
if(Bot.z == ai_Zlevel && !Bot.remote_disabled) //Only non-emagged bots on the same Z-level are detected!
bot_area = get_area(Bot)
var/bot_mode = Bot.get_mode()
d += "<tr><td width='30%'>[Bot.hacked ? "<span class='bad'>(!)</span>" : ""] [Bot.name]</A> ([Bot.model])</td>"
//If the bot is on, it will display the bot's current mode status. If the bot is not mode, it will just report "Idle". "Inactive if it is not on at all.
d += "<td width='30%'>[bot_mode]</td>"
d += "<td width='30%'>[bot_area.name]</td>"
d += "<td width='30%'>[get_area_name(Bot, TRUE)]</td>"
d += "<td width='10%'><A HREF=?src=[REF(src)];interface=[REF(Bot)]>Interface</A></td>"
d += "<td width='10%'><A HREF=?src=[REF(src)];callbot=[REF(Bot)]>Call</A></td>"
d += "</tr>"
@@ -503,7 +503,6 @@ Pass a positive integer as an argument to override a bot's default speed.
/mob/living/simple_animal/bot/proc/call_bot(caller, turf/waypoint, message=TRUE)
bot_reset() //Reset a bot before setting it to call mode.
var/area/end_area = get_area(waypoint)
//For giving the bot temporary all-access.
var/obj/item/card/id/all_access = new /obj/item/card/id
@@ -515,14 +514,15 @@ Pass a positive integer as an argument to override a bot's default speed.
ai_waypoint = waypoint
if(path && path.len) //Ensures that a valid path is calculated!
var/end_area = get_area_name(waypoint)
if(!on)
turn_on() //Saves the AI the hassle of having to activate a bot manually.
access_card = all_access //Give the bot all-access while under the AI's command.
if(client)
reset_access_timer_id = addtimer(CALLBACK (src, .proc/bot_reset), 600, TIMER_OVERRIDE|TIMER_STOPPABLE) //if the bot is player controlled, they get the extra access for a limited time
to_chat(src, "<span class='notice'><span class='big'>Priority waypoint set by [icon2html(calling_ai, src)] <b>[caller]</b>. Proceed to <b>[end_area.name]</b>.</span><br>[path.len-1] meters to destination. You have been granted additional door access for 60 seconds.</span>")
to_chat(src, "<span class='notice'><span class='big'>Priority waypoint set by [icon2html(calling_ai, src)] <b>[caller]</b>. Proceed to <b>[end_area]</b>.</span><br>[path.len-1] meters to destination. You have been granted additional door access for 60 seconds.</span>")
if(message)
to_chat(calling_ai, "<span class='notice'>[icon2html(src, calling_ai)] [name] called to [end_area.name]. [path.len-1] meters to destination.</span>")
to_chat(calling_ai, "<span class='notice'>[icon2html(src, calling_ai)] [name] called to [end_area]. [path.len-1] meters to destination.</span>")
pathset = 1
mode = BOT_RESPONDING
tries = 0
@@ -415,11 +415,9 @@
/mob/living/simple_animal/bot/mulebot/call_bot()
..()
var/area/dest_area
if(path && path.len)
target = ai_waypoint //Target is the end point of the path, the waypoint set by the AI.
dest_area = get_area(target)
destination = format_text(dest_area.name)
destination = get_area_name(target, TRUE)
pathset = 1 //Indicates the AI's custom path is initialized.
start()
@@ -608,7 +606,7 @@
if(AM && AM.Adjacent(src))
load(AM)
if(report_delivery)
speak("Now loading [load] at <b>[get_area(src)]</b>.", radio_channel)
speak("Now loading [load] at <b>[get_area_name(src)]</b>.", radio_channel)
// whatever happened, check to see if we return home
if(auto_return && home_destination && destination != home_destination)
@@ -85,8 +85,7 @@
playsound(user, "explosion", 100, 1)
var/turf/starting = get_turf(user)
var/turf/targturf = get_turf(target)
var/area/A = get_area(user)
var/log_str = "Blast wave fired from [ADMIN_COORDJMP(starting)] ([A.name]) at [ADMIN_COORDJMP(targturf)] ([target.name]) by [user.name]([user.ckey]) with power [heavy]/[medium]/[light]."
var/log_str = "Blast wave fired from [ADMIN_COORDJMP(starting)] ([get_area_name(user, TRUE)]) at [ADMIN_COORDJMP(targturf)] ([target.name]) by [user.name]([user.ckey]) with power [heavy]/[medium]/[light]."
message_admins(log_str)
log_game(log_str)
var/obj/item/projectile/blastwave/BW = new(loc, heavy, medium, light)
+1 -2
View File
@@ -35,8 +35,7 @@
chemical_mob_spawn_nicecritters += T
var/atom/A = holder.my_atom
var/turf/T = get_turf(A)
var/area/my_area = get_area(T)
var/message = "A [reaction_name] reaction has occurred in [my_area.name] [ADMIN_COORDJMP(T)]"
var/message = "A [reaction_name] reaction has occurred in [get_area_name(T)] [ADMIN_COORDJMP(T)]"
message += " (<A HREF='?_src_=vars;Vars=[REF(A)]'>VV</A>)"
var/mob/M = get(A, /mob)
+1 -2
View File
@@ -262,8 +262,7 @@
/obj/machinery/computer/bsa_control/proc/get_target_name()
if(istype(target, /area))
var/area/A = target
return A.name
return get_area_name(target, TRUE)
else if(istype(target, /obj/item/device/gps))
var/obj/item/device/gps/G = target
return G.gpstag