bugfix: The KINDOF_NO_SELECT flag now prevents an object from being selected - #3125
bugfix: The KINDOF_NO_SELECT flag now prevents an object from being selected#3125Stubbjax wants to merge 1 commit into
Conversation
PR Summary by QodoFix selection gating: KINDOF_NO_SELECT now blocks object selection
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR |
| if ( !testStatus(OBJECT_STATUS_UNSELECTABLE) ) | ||
| if ( !isEffectivelyDead() ) | ||
| //if ( !getTemplate()->isKindOf(KINDOF_DRONE) )//Most drones are unselectable from being slaved, but the SpyDrone needs help | ||
| if ( !getTemplate()->isKindOf(KINDOF_NO_SELECT) ) |
There was a problem hiding this comment.
Seems silly but is this safe for retail compatibility? I kind of doubt it. Selection is synchronized across clients and the AIGroup is part of the CRC.
There was a problem hiding this comment.
It probably depends whether this function is called in logical context or purely in client side selection (mouse and keyboard).
There was a problem hiding this comment.
I checked and selecting your own spy drone and trying to move it causes a mismatch between builds that have this change and ones that don't.
This will need to go behind the retail compatibility macro.
Skyaero42
left a comment
There was a problem hiding this comment.
I tested this against a number of replays and as @Caball009 suspected, it does mismatch.
Hence it needs to be behind RETAIL_CRC guards.
This change corrects object selection logic so that
KINDOF_NO_SELECTnow prevents an object from being selected as expected. It was originally only used when selecting previous/next units.As a result, existing objects that define
NO_SELECTin theirKindOffield are no longer selectable, but can be still attacked. This already applies to all USA Drones (including the Spy Drone), though vehicle drones are masked via a different process and thus the flag made no difference. The only other object affected by this change is the emerging Sneak Attack, which will require a data change if undesirable.