mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
Fixes SS13.register_signal throwing unclear errors when called on deleted datums (#82597)
## About The Pull Request See title ## Why It's Good For The Game More descriptive error message ## Changelog 🆑 fix: LUA: Registering a signal on a deleted datum will throw a more descriptive error message. /🆑 --------- Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
@@ -81,6 +81,10 @@ function SS13.register_signal(datum, signal, func)
|
||||
if not SS13.istype(datum, "/datum") then
|
||||
return
|
||||
end
|
||||
if not SS13.is_valid(datum) then
|
||||
error("Tried to register a signal on a deleted datum!", 2)
|
||||
return
|
||||
end
|
||||
local datumWeakRef = dm.global_proc("WEAKREF", datum)
|
||||
if not __SS13_signal_handlers[datumWeakRef] then
|
||||
__SS13_signal_handlers[datumWeakRef] = {}
|
||||
|
||||
Reference in New Issue
Block a user