Units automatically path around known hazards (eg static base defenses). Test using SAM and TRAN.

Todo: Ignore hazards when force-moving; Apply only to known enemy hazards; Implement more hazard classes

Also add a few files I forgot from previous patches
This commit is contained in:
Paul Chote
2010-06-25 13:53:37 +12:00
parent 0aeca2aadc
commit 7ac8d0cf59
15 changed files with 378 additions and 16 deletions

View File

@@ -90,14 +90,17 @@ namespace OpenRA.Mods.RA
}
}
public float GetCost(int2 p, UnitMovementType umt)
public float GetCost(int2 p, Actor forActor)
{
var umt = forActor.traits.Get<Mobile>().GetMovementType();
if (customTerrain[p.X, p.Y] != null)
return customTerrain[p.X,p.Y].GetCost(p,umt);
return 1f;
}
public float GetSpeedModifier(int2 p, UnitMovementType umt)
public float GetSpeedModifier(int2 p, Actor forActor)
{
var umt = forActor.traits.Get<Mobile>().GetMovementType();
if (customTerrain[p.X, p.Y] != null)
return customTerrain[p.X,p.Y].GetSpeedModifier(p,umt);
return 1f;