Add plumbing for customizable vertical ProximityTrigger range
And check DistanceAboveTerrain instead of just vertical distance to upgrade source. This is necessary to avoid situations where an actor is technically on the right vertical distance above/below ground, but not upgraded because it is located on a lower/higher terrain level than the upgrade source.
This commit is contained in:
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
// TODO: Eventually support CellTriggers as well
|
||||
proximityTrigger = self.World.ActorMap.AddProximityTrigger(self.CenterPosition, Info.Range, ActorEntered, ActorLeft);
|
||||
proximityTrigger = self.World.ActorMap.AddProximityTrigger(self.CenterPosition, Info.Range, WDist.Zero, ActorEntered, ActorLeft);
|
||||
}
|
||||
|
||||
void INotifyRemovedFromWorld.RemovedFromWorld(Actor self)
|
||||
@@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!self.IsInWorld || self.CenterPosition == prevPosition)
|
||||
return;
|
||||
|
||||
self.World.ActorMap.UpdateProximityTrigger(proximityTrigger, self.CenterPosition, Info.Range);
|
||||
self.World.ActorMap.UpdateProximityTrigger(proximityTrigger, self.CenterPosition, Info.Range, WDist.Zero);
|
||||
prevPosition = self.CenterPosition;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user