From b0ac4621661f44cadeffd0d0799466ff4bad5ef2 Mon Sep 17 00:00:00 2001 From: Krausus Date: Thu, 8 Sep 2016 19:04:50 -0400 Subject: [PATCH] Integrates UIDs into View Variables --- code/__HELPERS/mobs.dm | 2 +- code/__HELPERS/unique_ids.dm | 4 + code/datums/datumvars.dm | 210 ++++++++++-------- code/datums/diseases/advance/advance.dm | 2 +- code/game/gamemodes/nuclear/nuclearbomb.dm | 2 +- code/modules/admin/admin.dm | 2 +- code/modules/admin/verbs/SDQL2/SDQL_2.dm | 2 +- code/modules/admin/verbs/adminhelp.dm | 4 +- code/modules/admin/verbs/pray.dm | 12 +- code/modules/client/client procs.dm | 3 +- code/modules/error_handler/error_viewer.dm | 12 +- code/modules/paperwork/faxmachine.dm | 2 +- .../modules/reagents/newchem/newchem_procs.dm | 2 +- 13 files changed, 143 insertions(+), 116 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 9423c486698..edde3f13142 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -324,7 +324,7 @@ proc/add_logs(mob/user, mob/target, what_done, var/object=null, var/addition=nul to_chat(user, "Name = [M.name]; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = [M.key];") to_chat(user, "Location = [location_description];") to_chat(user, "[special_role_description]") - to_chat(user, "(PM) (PP) (VV) (SM) (FLW) (CA)") + to_chat(user, "(PM) (PP) (VV) (SM) (FLW) (CA)") // Gets the first mob contained in an atom, and warns the user if there's not exactly one /proc/get_mob_in_atom_with_warning(atom/A, mob/user = usr) diff --git a/code/__HELPERS/unique_ids.dm b/code/__HELPERS/unique_ids.dm index bd77c358aa8..9363df4252e 100644 --- a/code/__HELPERS/unique_ids.dm +++ b/code/__HELPERS/unique_ids.dm @@ -3,6 +3,10 @@ // Basically, a replacement for plain \refs that ensure the reference still // points to the exact same datum/client, but doesn't prevent GC like tags do. +// An unintended side effect of the way UIDs are formatted is that the locate() +// proc will ignore the number and attempt to locate the reference. I consider +// this a feature, since it means they're conveniently backwards compatible. + // Turns this: // var/myref = "\ref[mydatum]" // var/datum/D = locate(myref) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 7ce10664aee..6664c06dda0 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -170,27 +170,27 @@ if(istype(D,/atom)) var/atom/A = D if(isliving(A)) - body += "[D]" + body += "[D]" if(A.dir) - body += "
<< [dir2text(A.dir)] >>" + body += "
<< [dir2text(A.dir)] >>" var/mob/living/M = A - body += "
[M.ckey ? M.ckey : "No ckey"] / [M.real_name ? M.real_name : "No real name"]" + body += "
[M.ckey ? M.ckey : "No ckey"] / [M.real_name ? M.real_name : "No real name"]" body += {"
- BRUTE:[M.getBruteLoss()] - FIRE:[M.getFireLoss()] - TOXIN:[M.getToxLoss()] - OXY:[M.getOxyLoss()] - CLONE:[M.getCloneLoss()] - BRAIN:[M.getBrainLoss()] + BRUTE:[M.getBruteLoss()] + FIRE:[M.getFireLoss()] + TOXIN:[M.getToxLoss()] + OXY:[M.getOxyLoss()] + CLONE:[M.getCloneLoss()] + BRAIN:[M.getBrainLoss()] "} else - body += "[D]" + body += "[D]" if(A.dir) - body += "
<< [dir2text(A.dir)] >>" + body += "
<< [dir2text(A.dir)] >>" else body += "[D]" @@ -216,7 +216,7 @@ body += "" - body += "
Refresh" + body += "
Refresh" body += {"