Paradise
Paradise copied to clipboard
Fixes taking uplinks away
What Does This PR Do
fixes #18581 Makes traitor panel and uplink items no longer break when taking uplinks away.
Why It's Good For The Game
Apparently, on top of adding an uplink to an item, giving an uplink also makes hidden_uplink
variable refer to the new uplink.
When taking an uplink away, it would remove the uplink from the item, but not set the variable back to null
.
This prevented the traitor panel from updating correctly and caused the items to act weirdly.
Actually working admin tool that doesn't break items is good.
Testing
Spawned in. Made myself a traitor. Gave myself a PDA uplink. Took the PDA uplink away. Gave myself a radio headset uplink. Took the radio headset uplink away. Gave myself an uplink implant. Took the uplink implant away. Gave myself all three types of uplinks at once. Took them all with a single button. Items worked, traitor panel updated properly.
Changelog
:cl: fix: Fixed taking away uplinks in traitor panel for admins /:cl:
code looks good, can you please test this with uplink implants, we should check how this change will affect them.
Good catch, since uplink implants seem to work weirdly with hidden_uplink
var. Taking uplinks away using TP will now remove the implant and the associated action button.
Now that I think about it, maybe I can cut istype()
checks out by making some further changes.
That istype()
check under find_syndicate_uplink()
is sadly necessary.
Normal items disguised as uplinks have their hidden uplinks (de-facto an item within an item) qdel'd. This leaves the item intact while removing the uplink.
Currently on master, same logic is applied to an uplink implant. The hidden uplink item inside the implant gets qdel'd, but the implant itself remains in a mob's contents. It can be removed via surgery despite effectively being no longer an uplink implant.
This PR had some significant changes. It probably should be reconsidered on design level, not just code quality.
I'll try and get to reviewing this soon
this PR has had changes requested for 10 days now. filing as closed. feel free to re-open with the requested changes