bugfix(radar): Show Hero Radar icons in Containers and Tunnels again#2189
Open
xezon wants to merge 1 commit intoTheSuperHackers:mainfrom
Open
bugfix(radar): Show Hero Radar icons in Containers and Tunnels again#2189xezon wants to merge 1 commit intoTheSuperHackers:mainfrom
xezon wants to merge 1 commit intoTheSuperHackers:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Source/Common/System/Radar.cpp | Removed hero list management logic, simplified addObject() and removeObject() to use single list, cleaned up xfer version compatibility code |
| Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp | Modified drawIcons() to iterate m_localObjectList and filter heroes with isHero() check, removed hero list from updateObjectTexture() |
| GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp | Implemented hero tracking in tunnels: increments/decrements m_heroUnitsContained in add/remove methods, restores count in loadPostProcess() |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp | Simplified xfer to version 2, removed version 3 hero count serialization, hero count now restored via addToContainList() in loadPostProcess() |
Sequence Diagram
sequenceDiagram
participant Hero as Hero Object
participant Container as Container/Tunnel
participant Radar as Radar System
participant W3DRadar as W3DRadar::drawIcons()
Note over Hero,Radar: Before Fix (PR #1893)
Hero->>Radar: Added to m_localHeroObjectList
Container->>Radar: Added to m_localObjectList
Hero->>Container: Enters container
Note over W3DRadar: Iterates m_localHeroObjectList only
W3DRadar->>Hero: Draw hero icon
Note over W3DRadar,Hero: ❌ Container not in hero list<br/>Hero icon missing!
Note over Hero,Radar: After Fix (This PR)
Hero->>Radar: Added to m_localObjectList
Container->>Radar: Added to m_localObjectList
Hero->>Container: Enters container
Note over W3DRadar: Iterates m_localObjectList
W3DRadar->>Container: Check if hero? No, skip
W3DRadar->>Hero: Check if hero? Yes
W3DRadar->>Hero: Draw hero icon at position
Note over W3DRadar,Hero: ✓ Hero found and rendered!
Note over TunnelTracker: Tunnel System Enhancement
Hero->>TunnelTracker: addToContainList()
TunnelTracker->>TunnelTracker: Increment m_heroUnitsContained
TunnelContain->>TunnelTracker: getHeroUnitsContained()
TunnelTracker-->>TunnelContain: Return hero count
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change will show the Hero Radar icons in Containers and Tunnels again.
Previously we moved hero objects into its own radar object list, but this broke hero icons in containers, because containers are naturally not added in this hero objects list. This change returns to what the original did. Additionally the TunnelTracker also had the hero objects cache added, otherwise it did not work with tunnels.
TODO