mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Client: implement spectator mode via command-line options
If running with --spectate/-s CPlayerInterface will appear even without human players. Following command-line options also available: --spectate-ignore-hero --spectate-hero-speed=N --spectate-battle-speed=N --spectate-skip-battle --spectate-skip-battle-result Boolean options can also be changed in runtime via client console: set spectate-ignore-hero on / off Spectator mode also: - Work with --onlyAI option when starting game or loading saves. - Allow to use any cheat codes. - Give recon on towns and heroes.
This commit is contained in:
@ -1878,7 +1878,8 @@ void CGameHandler::run(bool resume)
|
||||
sbuffer << color << " ";
|
||||
{
|
||||
boost::unique_lock<boost::recursive_mutex> lock(gsm);
|
||||
connections[color] = cc;
|
||||
if(!color.isSpectator()) // there can be more than one spectator
|
||||
connections[color] = cc;
|
||||
}
|
||||
}
|
||||
logGlobal->info(sbuffer.str());
|
||||
@ -4430,7 +4431,9 @@ void CGameHandler::playerMessage(PlayerColor player, const std::string &message,
|
||||
{
|
||||
SystemMessage temp_message(VLC->generaltexth->allTexts.at(260));
|
||||
sendAndApply(&temp_message);
|
||||
checkVictoryLossConditionsForPlayer(player);//Player enter win code or got required art\creature
|
||||
|
||||
if(!player.isSpectator())
|
||||
checkVictoryLossConditionsForPlayer(player);//Player enter win code or got required art\creature
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user