From d5a765a36a6150689b79ba75f99cd7bb1ab2b6cb Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Wed, 19 Oct 2022 03:49:58 -0400 Subject: [PATCH] Fixes negative value being passed to runechat fade animation timer (#70531) --- code/datums/chatmessage.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/chatmessage.dm b/code/datums/chatmessage.dm index 319c135b5b1..c7a5823d504 100644 --- a/code/datums/chatmessage.dm +++ b/code/datums/chatmessage.dm @@ -199,7 +199,7 @@ // scheduled time once the EOL has been executed. if (!m.isFading) var/sched_remaining = timeleft(m.fadertimer, SSrunechat) - var/remaining_time = (sched_remaining) * (CHAT_MESSAGE_EXP_DECAY ** idx++) * (CHAT_MESSAGE_HEIGHT_DECAY ** combined_height) + var/remaining_time = max(0, (sched_remaining) * (CHAT_MESSAGE_EXP_DECAY ** idx++) * (CHAT_MESSAGE_HEIGHT_DECAY ** combined_height)) if (remaining_time) deltimer(m.fadertimer, SSrunechat) m.fadertimer = addtimer(CALLBACK(m, .proc/end_of_life), remaining_time, TIMER_STOPPABLE|TIMER_DELETE_ME, SSrunechat)