mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
"onlyai" command - game starts with no human players, only AI.
This commit is contained in:
@@ -69,6 +69,7 @@ std::queue<SDL_Event*> events;
|
||||
boost::mutex eventsM;
|
||||
|
||||
TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, *GEORM, *GEOR16;
|
||||
static bool gOnlyAI = false;
|
||||
|
||||
void processCommand(const std::string &message, CClient *&client);
|
||||
static void setScreenRes(int w, int h, int bpp, bool fullscreen);
|
||||
@@ -201,6 +202,14 @@ int main(int argc, char** argv)
|
||||
CPG->showMainMenu();
|
||||
StartInfo *options = new StartInfo(CPG->runLoop());
|
||||
|
||||
if(gOnlyAI)
|
||||
{
|
||||
for (size_t i =0; i < options->playerInfos.size(); i++)
|
||||
{
|
||||
options->playerInfos[i].human = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(screen->w != conf.cc.resx || screen->h != conf.cc.resy)
|
||||
{
|
||||
setScreenRes(conf.cc.resx,conf.cc.resy,conf.cc.bpp,conf.cc.fullscreen);
|
||||
@@ -405,6 +414,10 @@ void processCommand(const std::string &message, CClient *&client)
|
||||
*ptr = 666;
|
||||
//disaster!
|
||||
}
|
||||
else if(cn == "onlyai")
|
||||
{
|
||||
gOnlyAI = true;
|
||||
}
|
||||
else if(client && client->serv && client->serv->connected) //send to server
|
||||
{
|
||||
PlayerMessage pm(LOCPLINT->playerID,message);
|
||||
|
Reference in New Issue
Block a user