- bugfix for allowing players to view map at game end for network games

This commit is contained in:
Mark Vejvoda 2010-09-30 00:49:57 +00:00
parent 6013a96efd
commit 5ecda82be0
3 changed files with 9 additions and 4 deletions

View File

@ -1659,7 +1659,7 @@ void Game::checkWinnerStandard(){
if( this->gameSettings.isNetworkGame() == false ||
this->gameSettings.getEnableObserverModeAtEndGame() == true) {
// Let the happy winner view everything left in the world
world.setFogOfWar(false);
//world.setFogOfWar(false);
// This caused too much LAG for network games
if(this->gameSettings.isNetworkGame() == false) {
@ -1689,7 +1689,7 @@ void Game::checkWinnerStandard(){
if( this->gameSettings.isNetworkGame() == false ||
this->gameSettings.getEnableObserverModeAtEndGame() == true) {
// Let the poor user watch everything unfold
world.setFogOfWar(false);
//world.setFogOfWar(false);
// This caused too much LAG for network games
if(this->gameSettings.isNetworkGame() == false) {
@ -1733,7 +1733,7 @@ void Game::checkWinnerStandard(){
if( this->gameSettings.isNetworkGame() == false ||
this->gameSettings.getEnableObserverModeAtEndGame() == true) {
// Let the happy winner view everything left in the world
world.setFogOfWar(false);
//world.setFogOfWar(false);
// This caused too much LAG for network games
if(this->gameSettings.isNetworkGame() == false) {

View File

@ -160,6 +160,8 @@ public:
static string findFactionLogoFile(const GameSettings *settings, Logger *logger, string factionLogoFilter="loading_screen.*");
bool getGameOver() { return gameOver; }
private:
//render
void render3d();

View File

@ -1113,7 +1113,10 @@ void World::computeFow(int factionIdxToTick) {
for(int j = 0; j < map.getSurfaceH(); ++j) {
for(int k = 0; k < GameConstants::maxPlayers + GameConstants::specialFactions; ++k) {
if(fogOfWar || k != thisTeamIndex) {
if(k == thisTeamIndex && thisTeamIndex == GameConstants::maxPlayers -1 + fpt_Observer) {
if( k == thisTeamIndex &&
(thisTeamIndex == GameConstants::maxPlayers -1 + fpt_Observer ||
(game->getGameOver() == true && (game->getGameSettings()->isNetworkGame() == false ||
game->getGameSettings()->getEnableObserverModeAtEndGame() == true)))) {
map.getSurfaceCell(i, j)->setVisible(k, true);
map.getSurfaceCell(i, j)->setExplored(k, true);