Skip to content

Commit

Permalink
Fix visibility bug in new observer mode
Browse files Browse the repository at this point in the history
  • Loading branch information
axatin committed Jun 25, 2024
1 parent 0a707fc commit 11eb133
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CvGameCoreDLL_Expansion2/CvPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34607,8 +34607,19 @@ void CvPlayer::setTurnActive(bool bNewValue, bool bDoTurn) // R: bDoTurn default
if (MOD_CORE_DELAYED_VISIBILITY)
{
// Force update in case one of our units was killed or moved
TeamTypes eTeam = getTeam();
for (int iI = 0; iI < theMap.numPlots(); iI++)
theMap.plotByIndexUnchecked(iI)->flipVisibility(getTeam());
theMap.plotByIndexUnchecked(iI)->flipVisibility(eTeam);

// also update observer
if (GET_PLAYER(kGame.getActivePlayer()).isObserver() && kGame.getObserverUIOverridePlayer() == m_eID)
{
TeamTypes eObserverTeam = GET_PLAYER(kGame.getActivePlayer()).getTeam();
for (int iI = 0; iI < theMap.numPlots(); iI++)
{
theMap.plotByIndexUnchecked(iI)->flipVisibility(eObserverTeam);
}
}
}

if(kGame.getActivePlayer() == m_eID)
Expand Down

0 comments on commit 11eb133

Please sign in to comment.