Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Nov 22, 2025

Merge with Rebase

This change adds hero radar objects into its own list to get rid of hero cache updates and its related issues. As a side benefit the local radar object list render update is now also marginally cheaper because it no longer needs to update the hero objects cache.

This change contains 4 commits, of which 3 are refactors to simplify some Radar functions to make them reusable in other call sites.

TODO

  • Replicate in Generals

@xezon xezon added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project labels Nov 22, 2025
@xezon xezon force-pushed the xezon/fix-hero-radar-2 branch 2 times, most recently from 98b5355 to 3bd7411 Compare November 22, 2025 13:50
Bool W3DRadar::canRenderObject( const RadarObject *rObj, const Player *localPlayer )
{
if (rObj->isTemporarilyHidden())
return false;

Choose a reason for hiding this comment

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

You are using if-brackets for every other if statement in this function, while the original code did not. For consistency, I would also use brackets here.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

while( *list )
{

// get next object

Choose a reason for hiding this comment

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

Can remove comment as well. code is self-explanatory

Copy link
Author

Choose a reason for hiding this comment

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

Comments removed.

m_localObjectList->friend_getObject()->friend_setRadarData( NULL );
(*list)->friend_getObject()->friend_setRadarData( NULL );

// delete the head of the list

Choose a reason for hiding this comment

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

remove comment for self-explanatory code

Copy link
Author

Choose a reason for hiding this comment

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

Comments removed.

for( Object *obj = TheGameLogic->getFirstObject(); obj; obj = obj->getNextObject() )
{

DEBUG_ASSERTCRASH( obj->friend_getRadarData() == NULL, ("oops") );

Choose a reason for hiding this comment

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

Maybe take the opportunity for a more descriptive assert message.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@xezon xezon force-pushed the xezon/fix-hero-radar-2 branch from 3bd7411 to 41559c0 Compare November 24, 2025 19:13
@xezon xezon force-pushed the xezon/fix-hero-radar-2 branch from 41559c0 to fd63484 Compare November 25, 2025 20:55
@xezon
Copy link
Author

xezon commented Nov 25, 2025

Rebased on main.

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 Minor 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.

Hero Radar icon disappears for max 6 frames when leaving empty building

2 participants