Better antag tracking (#5816)

This PR moves the tracking of the antagonists from the char spawn to the assignment and removal of the antag status.

It should properly account for all antags that are added/removed via the add_antagonist / remove_antagonist verbs
This commit is contained in:
Werner
2018-12-22 23:42:47 +02:00
committed by Erki
parent 7ca12849fe
commit af0a4df520
4 changed files with 74 additions and 3 deletions
+2 -2
View File
@@ -461,8 +461,8 @@ datum/preferences
if(!H.mind.assigned_role)
log_debug("Char-Log: Char [current_character] - [H.name] has joined with mind.assigned_role set to NULL")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_characters_log (char_id, game_id, datetime, job_name, special_role, alt_title) VALUES (:char_id:, :game_id:, NOW(), :job:, :special_role:, :alt_title:)")
query.Execute(list("char_id" = current_character, "game_id" = game_id, "job" = H.mind.assigned_role, "special_role" = H.mind.special_role, "alt_title" = H.mind.role_alt_title))
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_characters_log (char_id, game_id, datetime, job_name, alt_title) VALUES (:char_id:, :game_id:, NOW(), :job:, :special_role:, :alt_title:)")
query.Execute(list("char_id" = current_character, "game_id" = game_id, "job" = H.mind.assigned_role, "alt_title" = H.mind.role_alt_title))
// Turned into a proc so we could reuse it for SQL shenanigans.
/datum/preferences/proc/new_setup(var/re_initialize = 0)