Skip to content

Conversation

Stubbjax
Copy link

@Stubbjax Stubbjax commented Sep 2, 2025

Fixes #29

This change prevents unit attachments from being visible through fog after exiting a Tunnel Network. The tunnel garrison logic goes through a different pathway and does not add the occupants of open containers (e.g. Avenger turrets) to the partition manager on exit. Unfortunately, this change is not retail compatible (though maybe for the best as it would introduce a disadvantage over retail).

See the comparison below:

SHROUD_COMP.mp4

Left client: This change - the blue player cannot see the turret attachment of the green Avenger through the fog ✔️
Right client: Retail build - the green player can see the turret attachment of the blue Avenger through the fog ❌

@Stubbjax Stubbjax self-assigned this Sep 2, 2025
@Stubbjax Stubbjax added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Sep 2, 2025
@Mauller
Copy link

Mauller commented Sep 2, 2025

I would check if this happens for contained objects being removed from a container in general.

Such as garrisoned structures, vehicles exiting helicopters etc.

Then this likely wants to go into the base remove from contained function call.

@Stubbjax
Copy link
Author

Stubbjax commented Sep 2, 2025

I would check if this happens for contained objects being removed from a container in general.

It does indeed via addOrRemoveObjFromWorld.

@Mauller
Copy link

Mauller commented Sep 2, 2025

I would check if this happens for contained objects being removed from a container in general.

It does indeed via addOrRemoveObjFromWorld.

So does this not happen for affected units with attachments exiting a helicopter in the fog?

@Stubbjax
Copy link
Author

Stubbjax commented Sep 2, 2025

I would check if this happens for contained objects being removed from a container in general.

It does indeed via addOrRemoveObjFromWorld.

So does this not happen for affected units with attachments exiting a helicopter in the fog?

Correct, see #29 (comment).

@@ -106,6 +106,20 @@ void TunnelContain::removeFromContain( Object *obj, Bool exposeStealthUnits )

owningPlayer->getTunnelSystem()->removeFromContain( obj, exposeStealthUnits );

#if !RETAIL_COMPATIBLE_CRC
if (obj->getContain())
Copy link

Choose a reason for hiding this comment

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

I wonder if this can be cleaned up just by calling addOrRemoveObjFromWorld(obj, TRUE); ?

Copy link
Author

@Stubbjax Stubbjax Sep 3, 2025

Choose a reason for hiding this comment

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

That was the way I had originally fixed it before making it more explicit. 😅 I went with this approach because addOrRemoveObjFromWorld(obj, TRUE); calls some of the same logic again, and I thought it might be better if the attachment wasn't added to the pathfinding grid (even though this admittedly adds an inconsistency).

@xezon xezon added Major Severity: Minor < Major < Critical < Blocker and removed Minor Severity: Minor < Major < Critical < Blocker labels Sep 4, 2025
@xezon xezon added this to the Major bug fixes milestone Sep 4, 2025
@@ -106,6 +106,9 @@ void TunnelContain::removeFromContain( Object *obj, Bool exposeStealthUnits )

owningPlayer->getTunnelSystem()->removeFromContain( obj, exposeStealthUnits );

#if !RETAIL_COMPATIBLE_CRC
addOrRemoveObjFromWorld(obj, TRUE);
Copy link

Choose a reason for hiding this comment

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

This placement looks suspicious, because there is no counterpart in the TunnelContain::addToContainList function.

The counter part appears to be at

// Which list to physically add to needs to be overridable
addToContainList(rider);
m_playerEnteredMask = rider->getControllingPlayer()->getPlayerMask();
if (isEnclosingContainerFor( rider ))
{
addOrRemoveObjFromWorld(rider, false);
}

I suggest to revisit.

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 Gen Relates to Generals Major Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

China Overlord and USA Avenger model parts can be seen under fog after exiting GLA Tunnel
3 participants