* Fix bug #8759 (in Skirmish mode it was possible to disable all AI players, we now check for that and make sure that at least one AI player is always available in Skirmish)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1451 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-04-13 14:48:23 +00:00
parent 0b359cf30b
commit 216eb52e3c
1 changed files with 18 additions and 2 deletions

View File

@ -30,7 +30,6 @@
#include <SDL/SDL_opengl.h>
#include "lib/framework/frameresource.h"
#include "lib/framework/strres.h"
#include "lib/framework/frameint.h"
// FIXME Direct iVis implementation include!
#include "lib/ivis_opengl/screen.h"
@ -51,7 +50,6 @@
#include "gateway.h"
#include <time.h>
#include "lib/gamelib/gtime.h"
#include "text.h"
#include "configuration.h"
#include "intdisplay.h"
#include "design.h"
@ -2291,6 +2289,24 @@ static void processMultiopWidgets(UDWORD id)
disableMultiButs();
// Ensure that Skirmish games have at least one AI player
if (game.type == SKIRMISH)
{
// Search for the first AI player we can find and make sure that it is enabled
for (i = 0; i < game.maxPlayers; ++i)
{
if (!isHumanPlayer(i))
{
if (game.skDiff[i] == 0)
{
game.skDiff[i] = 10;
}
break;
}
}
}
addPlayerBox(!ingame.bHostSetup || bHosted); //to make sure host can't skip player selection menu (sets game.skdiff to UBYTE_MAX for humans)
break;