Convert BaseProvider range check to world coords.
This commit is contained in:
@@ -83,18 +83,11 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
if (buildingInfo.RequiresBaseProvider)
|
||||
{
|
||||
var center = buildingInfo.CenterLocation(order.TargetLocation);
|
||||
foreach (var bp in w.ActorsWithTrait<BaseProvider>())
|
||||
{
|
||||
if (bp.Actor.Owner.Stances[self.Owner] != Stance.Ally || !bp.Trait.Ready())
|
||||
continue;
|
||||
|
||||
if (Combat.IsInRange(center, bp.Trait.Info.Range, bp.Actor.CenterLocation))
|
||||
{
|
||||
bp.Trait.BeginCooldown();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// May be null if the build anywhere cheat is active
|
||||
// BuildingInfo.IsCloseEnoughToBase has already verified that this is a valid build location
|
||||
var producer = buildingInfo.FindBaseProvider(w, self.Owner, order.TargetLocation);
|
||||
if (producer != null)
|
||||
producer.Trait<BaseProvider>().BeginCooldown();
|
||||
}
|
||||
|
||||
if (GetNumBuildables(self.Owner) > prevItems)
|
||||
|
||||
Reference in New Issue
Block a user