Skip to content
Permalink
Browse files

fix #6318

  • Loading branch information...
rtri
rtri committed Oct 11, 2019
1 parent 4c26c8e commit e5666f338cac8e2bf85e28568564b82b4050f80d
Showing with 5 additions and 14 deletions.
  1. +5 −14 rts/Game/Players/Player.cpp
@@ -3,7 +3,6 @@
#include <cassert>


#include "ExternalAI/SkirmishAIHandler.h"
#include "Player.h"
#include "PlayerHandler.h"
#include "Game/Camera.h"
@@ -52,7 +51,7 @@ void CPlayer::SetControlledTeams()
controlledTeams.reserve(teamHandler.ActiveTeams());

if (gs->godMode != 0) {
// anyone can control any unit
// anyone can control any (friendly and/or enemy) unit
for (int t = 0; t < teamHandler.ActiveTeams(); t++) {
if ((gs->godMode & GODMODE_ATC_BIT) != 0 && teamHandler.AlliedTeams(team, t))
controlledTeams.insert(t);
@@ -69,19 +68,11 @@ void CPlayer::SetControlledTeams()
return;
}

// my team
if (!spectator)
controlledTeams.insert(team);

// AI teams
for (const auto& p: skirmishAIHandler.GetAllSkirmishAIs()) {
const SkirmishAIData& sad = *(p.second);

if (sad.hostPlayer != playerNum)
continue;
if (spectator)
return;

controlledTeams.insert(sad.team);
}
// my team
controlledTeams.insert(team);
}


0 comments on commit e5666f3

Please sign in to comment.
You can’t perform that action at this time.