diff --git a/code/datums/mind.dm b/code/datums/mind.dm index da01e6136d1..2a492dfefc6 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -129,6 +129,9 @@ last_death = world.time /datum/mind/proc/store_memory(new_text) + var/newlength = length(memory) + length(new_text) + if (newlength > MAX_MESSAGE_LEN * 100) + memory = copytext(memory, -newlength-MAX_MESSAGE_LEN * 100) memory += "[new_text]
" /datum/mind/proc/wipe_memory() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ff49b57448d..5d643851d87 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -536,11 +536,13 @@ /mob/verb/add_memory(msg as message) set name = "Add Note" set category = "IC" - - msg = copytext(msg, 1, MAX_MESSAGE_LEN) - msg = sanitize(msg) - if(mind) + if (world.time < memory_throttle_time) + return + memory_throttle_time = world.time + 5 SECONDS + msg = copytext(msg, 1, MAX_MESSAGE_LEN) + msg = sanitize(msg) + mind.store_memory(msg) else to_chat(src, "You don't have a mind datum for some reason, so you can't add a note to it.") diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 5d96ba1321f..fa7b062f068 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -199,3 +199,5 @@ ///THe z level this mob is currently registered in var/registered_z = null + + var/memory_throttle_time = 0