Fixed bug : Restart loses custom settings

This commit is contained in:
jsalmon3 2002-08-07 03:37:36 +00:00
parent e655146ab7
commit 66b67391c8
4 changed files with 26 additions and 0 deletions

View file

@ -930,6 +930,7 @@
<LI>Added initial support for game replay (from Jimmy Salmon).
<LI>Fixed bug #536262: Oil icon changes colors (from Jimmy Salmon).
<LI>Fixed bug #587638: Transports can carry ships (from Jimmy Salmon).
<LI>Fixed bug #577066: Restart loses custom settings (from Jimmy Salmon).
<LI>+++
</UL>
</UL>

View file

@ -152,6 +152,9 @@ local void LoadMap(const char* filename,WorldMap* map)
-- Game creation
----------------------------------------------------------------------------*/
/**
** Free for all
*/
local void GameTypeFreeForAll(void)
{
int i;
@ -166,6 +169,9 @@ local void GameTypeFreeForAll(void)
}
}
/**
** Top vs Bottom
*/
local void GameTypeTopVsBottom(void)
{
int i;
@ -189,6 +195,9 @@ local void GameTypeTopVsBottom(void)
}
}
/**
** Left vs Right
*/
local void GameTypeLeftVsRight(void)
{
int i;
@ -484,6 +493,12 @@ global void InitSettings(void)
{
int i;
if (RestartScenario) {
TheMap.NoFogOfWar = GameSettings.NoFogOfWar;
FlagRevealMap = GameSettings.RevealMap;
return;
}
for (i = 0; i < PlayerMax; i++) {
GameSettings.Presets[i].Race = SettingsPresetMapDefault;
GameSettings.Presets[i].Team = SettingsPresetMapDefault;

View file

@ -68,6 +68,8 @@ struct _settings_ {
unsigned Opponents; /// Preset # of ai-opponents
unsigned Terrain; /// Terrain type (summer,winter,...)
unsigned GameType; /// Game type (melee, free for all,...)
unsigned NoFogOfWar; /// No fog of war
unsigned RevealMap; /// Reveal map
};
#define SettingsPresetMapDefault (~0ul) /// Special: Use pud/cm supplied

View file

@ -3780,18 +3780,26 @@ local void MultiGameFWSAction(Menuitem *mi, int i)
case 0:
TheMap.NoFogOfWar = 0;
FlagRevealMap = 0;
GameSettings.NoFogOfWar = 0;
GameSettings.RevealMap = 0;
break;
case 1:
TheMap.NoFogOfWar = 1;
FlagRevealMap = 0;
GameSettings.NoFogOfWar = 1;
GameSettings.RevealMap = 0;
break;
case 2:
TheMap.NoFogOfWar = 0;
FlagRevealMap = 1;
GameSettings.NoFogOfWar = 0;
GameSettings.RevealMap = 1;
break;
case 3:
TheMap.NoFogOfWar = 1;
FlagRevealMap = 1;
GameSettings.NoFogOfWar = 1;
GameSettings.RevealMap = 1;
break;
}
ServerSetupState.FwsOpt = i;