- bugfix for fog of war enabling at game end.. now works properly for Winning teams, not just losing teams.
This commit is contained in:
parent
143dd9035a
commit
bf8be83ccc
|
@ -1195,13 +1195,18 @@ bool World::showWorldForPlayer(int factionIndex) const {
|
||||||
game->getGameSettings()->isNetworkGame() == true &&
|
game->getGameSettings()->isNetworkGame() == true &&
|
||||||
game->getGameSettings()->getEnableObserverModeAtEndGame() == true) {
|
game->getGameSettings()->getEnableObserverModeAtEndGame() == true) {
|
||||||
ret = true;
|
ret = true;
|
||||||
// If the player has at least 1 Unit alive that is mobile (can move)
|
|
||||||
// then we cannot turn off fog of war
|
// If the faction is NOT on the winning team, don't let them see the map
|
||||||
for(int i = 0; i < getFaction(factionIndex)->getUnitCount(); ++i) {
|
// until all mobile units are dead
|
||||||
Unit *unit = getFaction(factionIndex)->getUnit(i);
|
if(getStats()->getVictory(factionIndex) == false) {
|
||||||
if(unit != NULL && unit->isAlive() && unit->getType()->isMobile() == true) {
|
// If the player has at least 1 Unit alive that is mobile (can move)
|
||||||
ret = false;
|
// then we cannot turn off fog of war
|
||||||
break;
|
for(int i = 0; i < getFaction(factionIndex)->getUnitCount(); ++i) {
|
||||||
|
Unit *unit = getFaction(factionIndex)->getUnit(i);
|
||||||
|
if(unit != NULL && unit->isAlive() && unit->getType()->isMobile() == true) {
|
||||||
|
ret = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user