fallback multiplier for CPUs playing for disconnected player. Should work now, needs testing .
This commit is contained in:
parent
3368ee3c96
commit
f2585ebaae
|
@ -838,7 +838,11 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
|
||||||
if(playerStatus == 1) {
|
if(playerStatus == 1) {
|
||||||
settings->setNetworkPlayerGameStatus(factionIndex,1);
|
settings->setNetworkPlayerGameStatus(factionIndex,1);
|
||||||
if(!world->getGame()->getGameOver()&& !this->world->getGame()->factionLostGame(factionIndex)){
|
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);
|
this->world->getStats()->setPlayerLeftBeforeEnd(factionIndex,true);
|
||||||
|
// set disconnect time for endgame stats
|
||||||
this->world->getStats()->setTimePlayerLeft(factionIndex,this->world->getStats()->getFramesToCalculatePlaytime());
|
this->world->getStats()->setTimePlayerLeft(factionIndex,this->world->getStats()->getFramesToCalculatePlaytime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1825,7 +1825,7 @@ void Game::ReplaceDisconnectedNetworkPlayersWithAI(bool isNetworkGame, NetworkRo
|
||||||
|
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
if(faction->getPersonalityType() != fpt_Observer) {
|
if(faction->getPersonalityType() != fpt_Observer) {
|
||||||
faction->setControlType(ctCpu);
|
faction->setControlType(ctCpuUltra);
|
||||||
aiInterfaces[i] = new AiInterface(*this, i, faction->getTeam(), faction->getStartLocationIndex());
|
aiInterfaces[i] = new AiInterface(*this, i, faction->getTeam(), faction->getStartLocationIndex());
|
||||||
|
|
||||||
sprintf(szBuf,Lang::getInstance().get("LogScreenGameLoadingCreatingAIFaction","",true).c_str(),i);
|
sprintf(szBuf,Lang::getInstance().get("LogScreenGameLoadingCreatingAIFaction","",true).c_str(),i);
|
||||||
|
|
|
@ -82,7 +82,8 @@ string PlayerStats::getStats() const {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if(control != ctHuman && control != ctNetwork ) {
|
if(control != ctHuman && control != ctNetwork ||
|
||||||
|
control == ctNetwork && playerLeftBeforeEnd==true) {
|
||||||
controlString += " x " + floatToStr(resourceMultiplier,1);
|
controlString += " x " + floatToStr(resourceMultiplier,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -321,7 +321,7 @@ void BattleEnd::render() {
|
||||||
controlString += "\nx " + floatToStr(stats.getResourceMultiplier(i),1);
|
controlString += "\nx " + floatToStr(stats.getResourceMultiplier(i),1);
|
||||||
}
|
}
|
||||||
else if(stats.getPlayerLeftBeforeEnd(i)==true){
|
else if(stats.getPlayerLeftBeforeEnd(i)==true){
|
||||||
controlString += "\n( " +lang.get("Cpu")+" )";
|
controlString += "\n" +lang.get("CpuUltra")+"\nx "+floatToStr(stats.getResourceMultiplier(i),1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(score == bestScore && stats.getVictory(i)) {
|
if(score == bestScore && stats.getVictory(i)) {
|
||||||
|
|
Loading…
Reference in New Issue