Paradise icon indicating copy to clipboard operation
Paradise copied to clipboard

Fixes taking uplinks away

Open Gatchapod opened this issue 1 year ago • 2 comments

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:

Gatchapod avatar Aug 15 '22 05:08 Gatchapod

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.

Gatchapod avatar Aug 16 '22 17:08 Gatchapod

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.

Gatchapod avatar Aug 16 '22 18:08 Gatchapod

This PR had some significant changes. It probably should be reconsidered on design level, not just code quality.

Gatchapod avatar Sep 01 '22 13:09 Gatchapod

I'll try and get to reviewing this soon

Sirryan2002 avatar Sep 04 '22 15:09 Sirryan2002

this PR has had changes requested for 10 days now. filing as closed. feel free to re-open with the requested changes

hal9000PR avatar Sep 17 '22 10:09 hal9000PR