Fix landing altitude checks.
Both GetPosition and LandPosition were trying to solve the problem of dynamic altitude offsets for carryalls with different-sized cargo. However, because they both apply the offsets, when the two are used together the two sets of offsets cancel to 0, producing incorrect behaviour. GetPosition is removed in favor of using CenterPosition with the dynamic LandAltitude. Fly.Tick and Carryall ignore the z coordinate so their behaviour is unchanged. Land and Aircraft.AtLandAltitude now return the correct result.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
0f22e3d4e4
commit
eb09870a10
@@ -309,8 +309,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (IsTraitDisabled)
|
||||
return false;
|
||||
|
||||
var targetCell = self.World.Map.CellContaining(aircraft.GetPosition());
|
||||
return Carryable != null && aircraft.CanLand(targetCell, blockedByMobile: false);
|
||||
return Carryable != null && aircraft.CanLand(self.Location, blockedByMobile: false);
|
||||
}
|
||||
|
||||
IEnumerable<IOrderTargeter> IIssueOrder.Orders
|
||||
|
||||
Reference in New Issue
Block a user