Remove BuildingInfluence from building adjacency check.
This commit is contained in:
committed by
Matthias Mailänder
parent
79019b06ca
commit
b9dd59cd63
@@ -204,7 +204,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var scanEnd = world.Map.Clamp(topLeft + buildingMaxBounds + new CVec(adjacent, adjacent));
|
var scanEnd = world.Map.Clamp(topLeft + buildingMaxBounds + new CVec(adjacent, adjacent));
|
||||||
|
|
||||||
var nearnessCandidates = new List<CPos>();
|
var nearnessCandidates = new List<CPos>();
|
||||||
var bi = world.WorldActor.Trait<BuildingInfluence>();
|
|
||||||
var allyBuildEnabled = mapBuildRadius != null && mapBuildRadius.AllyBuildRadiusEnabled;
|
var allyBuildEnabled = mapBuildRadius != null && mapBuildRadius.AllyBuildRadiusEnabled;
|
||||||
|
|
||||||
for (var y = scanStart.Y; y < scanEnd.Y; y++)
|
for (var y = scanStart.Y; y < scanEnd.Y; y++)
|
||||||
@@ -213,20 +212,20 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
var pos = new CPos(x, y);
|
var pos = new CPos(x, y);
|
||||||
|
|
||||||
var buildingAtPos = bi.GetBuildingAt(pos);
|
foreach (var a in world.ActorMap.GetActorsAt(pos))
|
||||||
|
|
||||||
if (buildingAtPos == null)
|
|
||||||
{
|
{
|
||||||
var unitsAtPos = world.ActorMap.GetActorsAt(pos).Where(a => a.IsInWorld
|
if (!a.IsInWorld)
|
||||||
&& (a.Owner == p || (allyBuildEnabled && a.Owner.Stances[p] == Stance.Ally))
|
continue;
|
||||||
&& ActorGrantsValidArea(a, requiresBuildableArea));
|
|
||||||
|
|
||||||
if (unitsAtPos.Any())
|
if (a.Owner != p && (!allyBuildEnabled || a.Owner.Stances[p] != Stance.Ally))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ActorGrantsValidArea(a, requiresBuildableArea))
|
||||||
|
{
|
||||||
nearnessCandidates.Add(pos);
|
nearnessCandidates.Add(pos);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (buildingAtPos.IsInWorld && ActorGrantsValidArea(buildingAtPos, requiresBuildableArea)
|
|
||||||
&& (buildingAtPos.Owner == p || (allyBuildEnabled && buildingAtPos.Owner.Stances[p] == Stance.Ally)))
|
|
||||||
nearnessCandidates.Add(pos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user