mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-28 18:11:16 +00:00
* Don't reregister PDA signals we already registered (#73525) ## About The Pull Request Fixes #73102 by removing an apparently purposeless proc. I'll be honest I have been staring and staring at this proc and have no idea what problem it is supposed to be solving and it looks kind of like nonsense, a victim of refactors maybe? So here's what it was doing: When you place an ID card into a PDA we register to the "moved" signal. When the PDA is moved we first check if the PDA's old location was a PDA. First head-scratcher, when would that be true? Was there a point where PDAs could be nested, back when they were tablets? Doesn't seem to be possible now. We then unregister the other signals we registered when setting up this proc, but _only_ if it was previously inside a PDA. Then we check if the source of the signal exists, which is also confusing but I _guess_ maybe something else listening to the move signal could have deleted it before we got here? The source of the signal of course continues to be the PDA we registered signals to. We only unregister those signals if it was previously somehow inside of a different PDA. We then re-register the signals we already registered on it, causing a warning runtime because we're registering a signal we already registered. Sure enough, the warning is telling us that we're just doing the same thing twice for as far as I can tell, absolutely no reason. As far as I can tell this proc... doesn't do anything _except_ runtime? It's full range of possible behaviour is to register some signals we are already registered to. So I fixed the bug by deleting it. If there's some edge case behaviour related to putting PDAs inside other PDAs which I am missing here, or I have misunderstood this code somehow, let me know. ## Why It's Good For The Game We shouldn't runtime every time you move your PDA around. ## Changelog 🆑 fix: Removes a runtime error caused by moving your PDA between slots. /🆑 * Don't reregister PDA signals we already registered --------- Co-authored-by: Jacquerel <hnevard@gmail.com>