Skip to content

[ZH] Fix game mismatch in team game when player surrenders and owns a base structure that has been cleared of infantry before #546

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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,21 @@ void Player::killPlayer(void)
}
if (isLocalPlayer() && !TheGameLogic->isInShellGame())
{
becomingLocalPlayer(TRUE); // recalc disguises, etc
// This calls recalcApparentControllingPlayer of all objects with a contain,
// which basically does two things:
// - Reset the teams of all objects with empty contains.
// - Update m_hideGarrisonedStateFromNonallies.
// The purpose originally probably was the latter so that the player who was killed,
// who is now observing, can see the hidden garrinsoned buildings. But that doesn't seem to work
// anyway, so this call is pointless.
// Unfortunately, there is another bug. The contains keep track of the team of the object
// before any units got inside. And that team doesn't get updated when a player gets killed
// and the units transfer to another team.
// In the end that means resetting the team sets it to neutral, and when this is done only for
// the local player a mismatch results.
// So for now we just comment it out. When we try to show disguises correctly for an observer
// or we fix the team bug in the Contain classes, we can include this again.
//becomingLocalPlayer(TRUE); // recalc disguises, etc
if (TheControlBar )
{
if (isPlayerActive())
Expand Down