bugfix: Clear stealth when driver killed by neutron/sniper#2250
bugfix: Clear stealth when driver killed by neutron/sniper#2250
Conversation
Co-authored-by: tintinhamans <5984296+tintinhamans@users.noreply.github.com>
Greptile Overview
|
| Filename | Overview |
|---|---|
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp | Added DISABLED_UNMANNED check in allowedToStealth() to prevent stealthed vehicles from remaining invisible when driver killed |
| Generals/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp | Added DISABLED_UNMANNED check in allowedToStealth() mirroring GeneralsMD fix for vanilla game compatibility |
Sequence Diagram
sequenceDiagram
participant Neutron as Neutron Shell/Jarmen Kell
participant Body as ActiveBody/NeutonBlastBehavior
participant Object as Vehicle Object
participant Stealth as StealthUpdate
participant Status as Visual Status
Neutron->>Body: Kill driver (DAMAGE_KILLPILOT)
Body->>Object: setDisabled(DISABLED_UNMANNED)
Note over Object: Vehicle now unmanned<br/>but still stealthed (BUG)
loop Every frame
Stealth->>Stealth: update()
Stealth->>Stealth: allowedToStealth()
Note over Stealth: NEW: Check DISABLED_UNMANNED
alt Vehicle is unmanned
Stealth-->>Stealth: return FALSE
Stealth->>Status: clearStatus(OBJECT_STATUS_STEALTHED)
Note over Status: Vehicle becomes visible
else Vehicle has driver
Stealth-->>Stealth: return TRUE
Stealth->>Status: setStatus(OBJECT_STATUS_STEALTHED)
Note over Status: Vehicle stays hidden
end
end
Stealthed vehicles hit by neutron shells or Jarmen Kell remain permanently invisible, undetectable even by stealth detectors.
Root Cause
StealthUpdate::allowedToStealth()doesn't checkDISABLED_UNMANNEDstate. When driver is killed, vehicle becomes unmanned but stealth persists.Changes
Added disabled check in
allowedToStealth()for both games:Existing logic in
update()automatically clearsOBJECT_STATUS_STEALTHEDwhenallowedToStealth()returns false.Notes
OBJECT_STATUS_STEALTHEDis client-side visual state, not syncedFALSE, Generals: lowercasefalse)Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.