Skip to content

Commit 527e596

Browse files
committed
Show message when toggling Human AI (cheat)
1 parent 4a2f1b3 commit 527e596

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

libs/s25main/network/GameClient.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,9 +1872,14 @@ void GameClient::ToggleHumanAIPlayer(const AI::Info& aiInfo)
18721872
auto it = helpers::find_if(game->aiPlayers_,
18731873
[id = this->GetPlayerId()](const auto& player) { return player.GetPlayerId() == id; });
18741874
if(it != game->aiPlayers_.end())
1875+
{
18751876
game->aiPlayers_.erase(it);
1876-
else
1877+
SystemChat(_("Disabled AI for current player"));
1878+
} else
1879+
{
18771880
game->AddAIPlayer(CreateAIPlayer(GetPlayerId(), aiInfo));
1881+
SystemChat(_("Enabled AI for current player"));
1882+
}
18781883
}
18791884

18801885
void GameClient::RequestSwapToPlayer(const unsigned char newId)

0 commit comments

Comments
 (0)