Allow units to give way when path is blocked by oncoming unit.

This commit is contained in:
tovl
2019-04-12 19:26:22 +02:00
committed by RoosterDragon
parent 32309bb8ea
commit 4a609bbee8
25 changed files with 309 additions and 184 deletions

View File

@@ -98,7 +98,7 @@ namespace OpenRA.Mods.D2k.Traits
if (!a.Info.HasTraitInfo<AttractsWormsInfo>())
return false;
return mobile.CanEnterCell(a.Location, null, false);
return mobile.CanEnterCell(a.Location, null, BlockedByActor.None);
};
var actorsInRange = self.World.FindActorsInCircle(self.CenterPosition, WormInfo.MaxSearchRadius)
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.D2k.Traits
var moveTo = self.World.Map.CellContaining(self.CenterPosition + noiseDirection);
while (!self.World.Map.Contains(moveTo) || !mobile.CanEnterCell(moveTo, null, false))
while (!self.World.Map.Contains(moveTo) || !mobile.CanEnterCell(moveTo, null, BlockedByActor.None))
{
// without this check, this while can be infinity loop
if (moveTo == self.Location)