Files
Bubberstation/code/modules/mod
_0Steven 5775cd8cd2 Fixes MODlink calls not cleaning up after themselves and bricking your ability to use them. (#92598)
## About The Pull Request

So I was notified MODlinks break after you use them, sometimes! 
Looking into it, seems the culprit code was this:

138a670347/code/modules/mod/mod_link.dm (L461-L467)
Specifically, MODlinks use `TRAIT_IN_CALL` to check whether the given
user is already in a call to block them from opening new calls even with
other MODlink devices.
However, as seen above, the call datum actually gets the *current* user
when cleaning up after itself, which if the call was ended by for
example taking off a scryer... returns null, and thus doesn't remove the
trait, and bars you from making new calls forever.
A similar issue exists when deleting the visuals! Where it fails to
unregister its signals on the user for the same reason.

We fix this by tracking our current calling user in a weakref, and
use/forward it where necessary.
We also move more of the behaviour away from the call itself, and
instead tell the MODlinks we've entered or exited a call.

I feel this entire system should really be refactored, but due to how
many hooks it needs and different ways to interact with it I'm not 100%
certain on the best way to do it. So, well, posting this fix instead of
letting it sit for the indeterminate amount of time needed for me to
work that out.
## Why It's Good For The Game

It's good if the things are actually functional.
## Changelog
🆑
fix: Ending a MODlink call in any non-standard way no longer bricks your
ability to use MODlinks.
fix: Ending a MODlink call in any non-standard way and then giving the
item to someone else to call with no longer moves the visuals based on
the first person to try to use the item.
/🆑
2025-08-17 03:30:15 +02:00
..