1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

* fixed bug in campaigns

* turned off artifacts.json creation
* minor changes
This commit is contained in:
mateuszb
2012-09-29 17:36:48 +00:00
parent 2001aeac92
commit 657ed41088
5 changed files with 43 additions and 34 deletions

View File

@@ -274,7 +274,7 @@ void CClient::loadGame( const std::string & fname )
{
*serv << ui8(it->first); //players
}
*serv << ui8(255); // neutrals
*serv << ui8(GameConstants::NEUTRAL_PLAYER);
tlog0 <<"Sent info to server: "<<tmh.getDiff()<<std::endl;
serv->enableStackSendingByID();
@@ -312,7 +312,7 @@ void CClient::newGame( CConnection *con, StartInfo *si )
}
}
if(networkMode != GUEST)
myPlayers.insert(255); //neutral
myPlayers.insert(GameConstants::NEUTRAL_PLAYER);
CStopWatch tmh;
const_cast<CGameInfo*>(CGI)->state = new CGameState();
@@ -466,7 +466,7 @@ void CClient::serialize( Handler &h, const int version )
CGameInterface *nInt = NULL;
if(dllname.length())
{
if(pid == 255)
if(pid == GameConstants::NEUTRAL_PLAYER)
{
//CBattleCallback * cbc = new CBattleCallback(gs, pid, this);//FIXME: unused?
CBattleGameInterface *cbgi = CDynLibHandler::getNewBattleAI(dllname);
@@ -617,10 +617,10 @@ void CClient::battleFinished()
void CClient::loadNeutralBattleAI()
{
battleints[255] = CDynLibHandler::getNewBattleAI(settings["server"]["neutralAI"].String());
auto cbc = make_shared<CBattleCallback>(gs, 255, this);
battleCallbacks[255] = cbc;
battleints[255]->init(cbc.get());
battleints[GameConstants::NEUTRAL_PLAYER] = CDynLibHandler::getNewBattleAI(settings["server"]["neutralAI"].String());
auto cbc = make_shared<CBattleCallback>(gs, GameConstants::NEUTRAL_PLAYER, this);
battleCallbacks[GameConstants::NEUTRAL_PLAYER] = cbc;
battleints[GameConstants::NEUTRAL_PLAYER]->init(cbc.get());
}
void CClient::commitPackage( CPackForClient *pack )