From d37c2c12f758a2f5fa5c8f2506d2a0051a5f6fb6 Mon Sep 17 00:00:00 2001 From: Lzimann Date: Fri, 26 May 2017 23:10:15 -0300 Subject: [PATCH] Individual logs are no longer lost with mob changes --- code/_globalvars/logging.dm | 2 ++ code/modules/admin/verbs/individual_logging.dm | 4 ++-- code/modules/mob/login.dm | 6 +++++- code/modules/mob/mob_defines.dm | 2 +- code/modules/mob/mob_helpers.dm | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index 00665bdfe22..72ca1e93280 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -31,4 +31,6 @@ GLOBAL_PROTECT(OOClog) GLOBAL_LIST_EMPTY(adminlog) GLOBAL_PROTECT(adminlog) +GLOBAL_LIST_EMPTY(individual_log_list) // Logs each mob individual logs, a global so it doesn't get lost on cloning/changing mobs + GLOBAL_LIST_EMPTY(active_turfs_startlist) \ No newline at end of file diff --git a/code/modules/admin/verbs/individual_logging.dm b/code/modules/admin/verbs/individual_logging.dm index cef424d4b28..d7db82f5b34 100644 --- a/code/modules/admin/verbs/individual_logging.dm +++ b/code/modules/admin/verbs/individual_logging.dm @@ -16,7 +16,7 @@ for(var/log_type in M.logging) var/list/reversed = M.logging[log_type] reversed = reverseRange(reversed.Copy()) - dat += "
[log_type]

" + dat += "
[log_type]

" for(var/entry in reversed) dat += "[entry]: [reversed[entry]]
" dat += "
" @@ -26,6 +26,6 @@ if(reversed) reversed = reverseRange(reversed.Copy()) for(var/entry in reversed) - dat += "[entry]: [reversed[entry]]
" + dat += "[entry]: [reversed[entry]]
" usr << browse(dat, "window=invidual_logging;size=600x480") \ No newline at end of file diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index a6f0c981441..aa284b2b8ed 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -39,4 +39,8 @@ if(client) client.click_intercept = null - client.view = world.view // Resets the client.view in case it was changed. \ No newline at end of file + client.view = world.view // Resets the client.view in case it was changed. + + if(!LAZYLEN(GLOB.individual_log_list[ckey])) + GLOB.individual_log_list[ckey] = list(INDIVIDUAL_ATTACK_LOG, INDIVIDUAL_SAY_LOG, INDIVIDUAL_EMOTE_LOG, INDIVIDUAL_OOC_LOG) + logging = GLOB.individual_log_list[ckey] diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 20d98027c7d..87bbfcaa274 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -29,7 +29,7 @@ var/computer_id = null var/lastattacker = null var/lastattacked = null - var/list/logging = list(INDIVIDUAL_ATTACK_LOG, INDIVIDUAL_SAY_LOG, INDIVIDUAL_EMOTE_LOG, INDIVIDUAL_OOC_LOG) + var/list/logging var/obj/machinery/machine = null var/other_mobs = null var/disabilities = 0 //Carbon diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index a704c2e43f0..6c70dc866a0 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -473,7 +473,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp ClickOn(T) /mob/proc/log_message(message, message_type) - if(!LAZYLEN(message) || !message_type) + if(!LAZYLEN(message) || !message_type || !client) return if(!islist(logging[message_type]))