diff --git a/SQL/migrate/V032__more_do_options.sql b/SQL/migrate/V032__more_do_options.sql new file mode 100644 index 00000000000..f51e9e24768 --- /dev/null +++ b/SQL/migrate/V032__more_do_options.sql @@ -0,0 +1,6 @@ +-- +-- Adds alt_title logging to the ss13_characters_log +-- + +ALTER TABLE `ss13_characters_log` + ADD COLUMN `alt_title` VARCHAR(32) NULL DEFAULT NULL AFTER `job_name`; diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 02985d31451..50570215101 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -458,8 +458,11 @@ datum/preferences if (!config.sql_saves || !config.sql_stats || !establish_db_connection(dbcon) || !H) return - var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_characters_log (char_id, game_id, datetime, job_name, special_role) VALUES (:char_id:, :game_id:, NOW(), :job:, :special_role:)") - query.Execute(list("char_id" = current_character, "game_id" = game_id, "job" = H.mind.assigned_role, "special_role" = H.mind.special_role)) + 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)) // Turned into a proc so we could reuse it for SQL shenanigans. /datum/preferences/proc/new_setup(var/re_initialize = 0)