- attempt to bugfix out of synch when players disconnect and we switch to AI
This commit is contained in:
parent
165f281f92
commit
1d98015d5d
|
@ -27,7 +27,7 @@ using namespace Shared::Platform;
|
|||
namespace Glest { namespace Game {
|
||||
|
||||
const char *mailString = " http://bugs.megaglest.org";
|
||||
const string glestVersionString = "v3.7.0-beta1";
|
||||
const string glestVersionString = "v3.7.0-dev";
|
||||
#if defined(SVNVERSION)
|
||||
const string SVN_Rev = string("Rev: ") + string(SVNVERSION);
|
||||
#elif defined(SVNVERSIONHEADER)
|
||||
|
|
|
@ -896,9 +896,12 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
|
|||
//printf("nctPlayerStatusChange -> faction->getPersonalityType() = %d index [%d] control [%d] networkstatus [%d]\n",
|
||||
// world->getFaction(factionIndex)->getPersonalityType(),world->getFaction(factionIndex)->getIndex(),world->getFaction(factionIndex)->getControlType(),settings->getNetworkPlayerStatuses(factionIndex));
|
||||
|
||||
settings->setFactionControl(factionIndex,ctCpuUltra);
|
||||
settings->setResourceMultiplierIndex(factionIndex,settings->getFallbackCpuMultiplier());
|
||||
|
||||
if(!world->getGame()->getGameOver()&& !this->world->getGame()->factionLostGame(factionIndex)){
|
||||
// use the fallback multiplier here
|
||||
settings->setResourceMultiplierIndex(factionIndex,settings->getFallbackCpuMultiplier());
|
||||
|
||||
// mark player as "leaver"
|
||||
this->world->getStats()->setPlayerLeftBeforeEnd(factionIndex,true);
|
||||
// set disconnect time for endgame stats
|
||||
|
|
|
@ -1903,7 +1903,7 @@ void Game::ReplaceDisconnectedNetworkPlayersWithAI(bool isNetworkGame, NetworkRo
|
|||
|
||||
char szBuf[4096]="";
|
||||
if(faction->getPersonalityType() != fpt_Observer) {
|
||||
faction->setControlType(ctCpuUltra);
|
||||
//faction->setControlType(ctCpuUltra);
|
||||
aiInterfaces[i] = new AiInterface(*this, i, faction->getTeam(), faction->getStartLocationIndex());
|
||||
|
||||
sprintf(szBuf,Lang::getInstance().get("LogScreenGameLoadingCreatingAIFaction","",true).c_str(),i);
|
||||
|
|
Loading…
Reference in New Issue