Fixes the bug where we would save the map, but not max players, so you
could have a 8p map with only 4p, or worse, a 2p map with 4p.
Also fixes formatting of comments a bit.
Index: src/configuration.c
===
--- src/configuration.c (revision 5107)
+++ src/configuration.c (working copy)
@@ -407,6 +407,21 @@
if(getWarzoneKeyString("mapName", sBuf))
{
sstrcpy(game.map, sBuf);
+ if (getWarzoneKeyNumeric("maxPlayers", &val))
+ {
+ game.maxPlayers = val;
+ }
+ else
+ {
+ debug(LOG_ERROR,"Invalid or not found maxPlayers
parameter for map
%s",game.map);
+ debug(LOG_ERROR,"Reseting map to default parameters.");
+ // we don't have maxPlayers set, so fall back to
defaults.
+ game.maxPlayers = 4;//4 is for the DEFAULTMAPNAME
map (rush)
+ sstrcpy(game.map, DEFAULTMAPNAME);
+ setWarzoneKeyString("mapName", game.map);
+ setWarzoneKeyNumeric("maxPlayers",game.maxPlayers);
+
+ }
}
else
{
@@ -658,20 +673,21 @@
debug( LOG_NEVER, "Writing multiplay prefs to registry\n" );
if(NetPlay.bHost && ingame.localJoiningInProgress)
{
- setWarzoneKeyString("gameName", game.name);
// last hosted game
+ setWarzoneKeyString("gameName", game.name);
// last hosted game
}
setWarzoneKeyString("mapName", game.map);
// map name
- setWarzoneKeyNumeric("power", game.power);
// power
+ setWarzoneKeyNumeric("maxPlayers",game.maxPlayers);
// maxPlayers
+ setWarzoneKeyNumeric("power", game.power);
// power
setWarzoneKeyNumeric("type", game.type);
// game type
setWarzoneKeyNumeric("base", game.base);
// size of base
- setWarzoneKeyNumeric("fog", game.fog);
// fog 'o war
- setWarzoneKeyNumeric("alliance", game.alliance);
// allow alliances
+ setWarzoneKeyNumeric("fog", game.fog);
// fog 'o war
+ setWarzoneKeyNumeric("alliance", game.alliance);
// allow alliances
setWarzoneKeyString("playerName",(char*)sPlayer);
// player name
- setWarzoneKeyString("phrase0", ingame.phrases[0]); //
phrases
- setWarzoneKeyString("phrase1", ingame.phrases[1]);
- setWarzoneKeyString("phrase2", ingame.phrases[2]);
- setWarzoneKeyString("phrase3", ingame.phrases[3]);
- setWarzoneKeyString("phrase4", ingame.phrases[4]);
+ setWarzoneKeyString("phrase0", ingame.phrases[0]);
// phrases
+ setWarzoneKeyString("phrase1", ingame.phrases[1]);
// unused ?
+ setWarzoneKeyString("phrase2", ingame.phrases[2]);
// unused ?
+ setWarzoneKeyString("phrase3", ingame.phrases[3]);
// unused ?
+ setWarzoneKeyString("phrase4", ingame.phrases[4]);
// unused ?
}
return closeWarzoneKey();
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev