Use cell positioning to look up resupply actors. Fixes #3901.
FindActorsInBox only checks against the centre of actors, so testing two points is rarely going to work.
This commit is contained in:
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
if (!limitedAmmo.GiveAmmo()) return NextActivity;
|
||||
|
||||
var hostBuilding = self.World.FindActorsInBox(self.CenterPosition, self.CenterPosition)
|
||||
var hostBuilding = self.World.ActorMap.GetUnitsAt(self.Location)
|
||||
.FirstOrDefault(a => a.HasTrait<RenderBuilding>());
|
||||
|
||||
if (hostBuilding != null)
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.RA.Air
|
||||
if (self.CenterPosition.Z != 0)
|
||||
return null; // not on the ground.
|
||||
|
||||
return self.World.FindActorsInBox(self.CenterPosition, self.CenterPosition)
|
||||
return self.World.ActorMap.GetUnitsAt(self.Location)
|
||||
.FirstOrDefault(a => a.HasTrait<Reservable>());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user