Fixes stack_traces not displaying properly if the runtime happened too early (#87055)

## About The Pull Request

Just atomizing the misc fix I found in
<https://github.com/tgstation/tgstation/pull/86527> because I may not
get to finish that PR for a little bit, and this fix should go through
in the meantime because I encountered the bug _again_ with a separate
issue, resulting in no stack_traces, and it annoyed me.

Fixes runtimes showing with no stack_trace output because the error
handling proc itself was runtiming... (`/world/Error()`)


![365350779-3ee5e97a-0754-4615-ae9a-1daf39d8bde1](https://github.com/user-attachments/assets/1a1af09b-2143-483f-80eb-afeacf5772c1)

Besides the linked PR, another example of this happening was with
loadout datum collisions. So this should make debugging things like that
actually sane and normal again.

## Why It's Good For The Game

Fixes some order of operations nonsense (with the static var in question
not being initialized immediately) by initializing it explicitly here.
Stack traces are good.

## Changelog
Edit: backend issue
This commit is contained in:
Bloop
2024-10-06 00:35:56 -04:00
committed by Majkl-J
parent d7db4d9eff
commit d31faac13c
+3 -1
View File
@@ -26,7 +26,9 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
Reboot(reason = 1)
return
var/static/regex/stack_workaround = regex("[WORKAROUND_IDENTIFIER](.+?)[WORKAROUND_IDENTIFIER]")
var/static/regex/stack_workaround
if(isnull(stack_workaround))
stack_workaround = regex("[WORKAROUND_IDENTIFIER](.+?)[WORKAROUND_IDENTIFIER]")
var/static/list/error_last_seen = list()
var/static/list/error_cooldown = list() /* Error_cooldown items will either be positive(cooldown time) or negative(silenced error)
If negative, starts at -1, and goes down by 1 each time that error gets skipped*/