Remove BuildingInfluence from Aircraft.
This commit is contained in:
committed by
Matthias Mailänder
parent
1a3dfdc67f
commit
e4faa6b0f0
@@ -1239,7 +1239,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class AircraftMoveOrderTargeter : IOrderTargeter
|
||||
{
|
||||
readonly Aircraft aircraft;
|
||||
readonly BuildingInfluence bi;
|
||||
|
||||
public string OrderID { get; protected set; }
|
||||
public int OrderPriority { get { return 4; } }
|
||||
@@ -1248,7 +1247,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public AircraftMoveOrderTargeter(Aircraft aircraft)
|
||||
{
|
||||
this.aircraft = aircraft;
|
||||
bi = aircraft.self.World.WorldActor.TraitOrDefault<BuildingInfluence>();
|
||||
OrderID = "Move";
|
||||
}
|
||||
|
||||
@@ -1273,8 +1271,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// selection for left-mouse orders
|
||||
if (modifiers.HasModifier(TargetModifiers.ForceMove) && aircraft.Info.CanForceLand)
|
||||
{
|
||||
var building = bi.GetBuildingAt(location);
|
||||
if (building == null || building.TraitOrDefault<Selectable>() == null || aircraft.CanLand(location, blockedByMobile: false))
|
||||
var buildingAtLocation = self.World.ActorMap.GetActorsAt(location)
|
||||
.Any(a => a.TraitOrDefault<Building>() != null && a.TraitOrDefault<Selectable>() != null);
|
||||
|
||||
if (!buildingAtLocation || aircraft.CanLand(location, blockedByMobile: false))
|
||||
OrderID = "Land";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user