Skip to content

[GEN][ZH] Fix Hero Radar issues introduced by #1035 #1240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xezon
Copy link

@xezon xezon commented Jul 7, 2025

This change fixes 2 issues that were introduced by #1035.

Issue 1

Hero icons from team mates or enemies were visible on the Radar. This issue happened because the changed code incorrectly added all Hero objects to m_cachedHeroObjectList, and not just those that are isLocallyControlled.

Issue 2

Using Saveload with Hero units could crash the game. I suspect this happened because after xfer not all objects were purged from m_cachedHeroObjectList. The new code will now rebuild m_cachedHeroObjectList after xfer load, because that also rebuilt the underlying radar object lists.

TODO

  • Replicate in Generals

@xezon xezon added Bug Something is not working right, typically is user facing Major Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project Crash This is a crash, very bad labels Jul 7, 2025
@Caball009
Copy link

Caball009 commented Jul 7, 2025

Would you mind adding a bit more information about the fixes?

EDIT: I think the issue description speaks for itself, but the code might not.

@Mauller
Copy link

Mauller commented Jul 7, 2025

Okay, so this fixes the crash problem and likely the issue with enemy heroes always showing on the radar.

So one thing i did notice from this is that Observers don't get hero icons showing on the radar.
The hero icons showing when i was playing back GR1 made me notice them more.

I wonder if there is some logic broken elsewhere that is stopping "revealed" heroes from showing for players and observers.

@xezon
Copy link
Author

xezon commented Jul 7, 2025

The condition for showing hero icons is object->isLocallyControlled().

@Mauller
Copy link

Mauller commented Jul 7, 2025

The condition for showing hero icons is object->isLocallyControlled().

Yeah i just noticed that, so hero icons were only ever meant to show up for your own heroes and not all revealed heroes.

It was actually quite nice to spot all heroes when as an observer. Could be a nice feature to add later on.

Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fixes both issues with crashing on load and in the replay that was crashing.

The game crash was likely due to enemy heroes being on another players radar when they should not have been.

@xezon
Copy link
Author

xezon commented Jul 7, 2025

Would you mind adding a bit more information about the fixes?

Done.

@Mauller
Copy link

Mauller commented Jul 7, 2025

The condition for showing hero icons is object->isLocallyControlled().

Just doing the following lets it work for observers

if( obj->isLocallyControlled() || ThePlayerList->getLocalPlayer()->isPlayerObserver() )

It is quite neat being able to see where heroes are during a replay.
image

@xezon
Copy link
Author

xezon commented Jul 7, 2025

Yeah it's nice.

@Mauller
Copy link

Mauller commented Jul 7, 2025

Yeah it's nice.

It's also what caused the crash when the hero was in the tunnel system in the replay. lol
Fish hero tunnel radar crash.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working right, typically is user facing Crash This is a crash, very bad Major Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants