forked from mirrors/0ad
Fix wrong playerID used for the controlAll developer overlay option in 96a6a136b6/D2383.
Reported By: Freagarach This was SVN commit r23098.
This commit is contained in:
@@ -223,7 +223,9 @@ function determineAction(x, y, fromMinimap)
|
||||
return undefined;
|
||||
|
||||
// If the selection isn't friendly units, no action
|
||||
if (!selection.every(canControlEntity))
|
||||
if (!selection.every(ownsEntity) &&
|
||||
!(g_SimState.players[g_ViewedPlayer] &&
|
||||
g_SimState.players[g_ViewedPlayer].controlsAll))
|
||||
return undefined;
|
||||
|
||||
var target = undefined;
|
||||
@@ -273,17 +275,10 @@ function determineAction(x, y, fromMinimap)
|
||||
return { "type": "none", "cursor": "", "target": target };
|
||||
}
|
||||
|
||||
function canControlEntity(ent)
|
||||
function ownsEntity(ent)
|
||||
{
|
||||
let entState = GetEntityState(ent);
|
||||
if (!entState)
|
||||
return false;
|
||||
|
||||
if (entState.player == g_ViewedPlayer)
|
||||
return true;
|
||||
|
||||
let playerState = g_SimState.players[entState.player];
|
||||
return playerState && playerState.controlsAll;
|
||||
return entState && entState.player == g_ViewedPlayer;
|
||||
}
|
||||
|
||||
function tryPlaceBuilding(queued)
|
||||
|
||||
Reference in New Issue
Block a user