mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +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:
@ -29,6 +29,7 @@ const SlotID SlotID::SUMMONED_SLOT_PLACEHOLDER = SlotID(-3);
|
||||
const SlotID SlotID::WAR_MACHINES_SLOT = SlotID(-4);
|
||||
const SlotID SlotID::ARROW_TOWERS_SLOT = SlotID(-5);
|
||||
|
||||
const PlayerColor PlayerColor::SPECTATOR = PlayerColor(252);
|
||||
const PlayerColor PlayerColor::CANNOT_DETERMINE = PlayerColor(253);
|
||||
const PlayerColor PlayerColor::UNFLAGGABLE = PlayerColor(254);
|
||||
const PlayerColor PlayerColor::NEUTRAL = PlayerColor(255);
|
||||
@ -72,6 +73,11 @@ bool PlayerColor::isValidPlayer() const
|
||||
return num < PLAYER_LIMIT_I;
|
||||
}
|
||||
|
||||
bool PlayerColor::isSpectator() const
|
||||
{
|
||||
return num == 252;
|
||||
}
|
||||
|
||||
std::string PlayerColor::getStr(bool L10n) const
|
||||
{
|
||||
std::string ret = "unnamed";
|
||||
|
Reference in New Issue
Block a user