Fixes antag logs (#38658)

* Fixes roundstart antag logging.

* Fixes roundend antag logging.

* Handles blown up minds.

* whoops

* total antag cleanup
This commit is contained in:
AnturK
2018-06-23 23:30:16 +02:00
committed by letterjay
parent 386bc528ea
commit 843c05aa82
2 changed files with 28 additions and 15 deletions
+9 -10
View File
@@ -203,21 +203,20 @@
//Print a list of antagonists to the server log
var/list/total_antagonists = list()
//Look into all mobs in world, dead or alive
for(var/datum/mind/Mind in minds)
var/temprole = Mind.special_role
if(temprole) //if they are an antagonist of some sort.
if(temprole in total_antagonists) //If the role exists already, add the name to it
total_antagonists[temprole] += ", [Mind.name]([Mind.key])"
else
total_antagonists.Add(temprole) //If the role doesnt exist in the list, create it and add the mob
total_antagonists[temprole] += ": [Mind.name]([Mind.key])"
for(var/datum/antagonist/A in GLOB.antagonists)
if(!A.owner)
continue
if(!(A.name in total_antagonists))
total_antagonists[A.name] = list()
total_antagonists[A.name] += "[key_name(A.owner)]"
CHECK_TICK
//Now print them all into the log!
log_game("Antagonists at round end were...")
for(var/i in total_antagonists)
log_game("[i]s[total_antagonists[i]].")
for(var/antag_name in total_antagonists)
var/list/L = total_antagonists[antag_name]
log_game("[antag_name]s :[L.Join(", ")].")
CHECK_TICK
SSdbcore.SetRoundEnd()
+19 -5
View File
@@ -375,6 +375,7 @@ Turf and target are separate in case you want to teleport some distance from a t
var/client/C
var/key
var/ckey
var/fallback_name
if(!whom)
return "*null*"
@@ -394,6 +395,16 @@ Turf and target are separate in case you want to teleport some distance from a t
C = GLOB.directory[ckey]
if(C)
M = C.mob
else if(istype(whom,/datum/mind))
var/datum/mind/mind = whom
key = mind.key
ckey = ckey(key)
if(mind.current)
M = mind.current
if(M.client)
C = M.client
else
fallback_name = mind.name
else
return "*invalid*"
@@ -419,11 +430,14 @@ Turf and target are separate in case you want to teleport some distance from a t
else
. += "*no key*"
if(include_name && M)
if(M.real_name)
. += "/([M.real_name])"
else if(M.name)
. += "/([M.name])"
if(include_name)
if(M)
if(M.real_name)
. += "/([M.real_name])"
else if(M.name)
. += "/([M.name])"
else if(fallback_name)
. += "/([fallback_name])"
return .