Shift movement cost/speed into IMove; regressions in a few areas

This commit is contained in:
Paul Chote
2010-06-25 17:05:56 +12:00
parent 6a5869f2c6
commit 29fa9e3aeb
20 changed files with 178 additions and 132 deletions

View File

@@ -92,17 +92,19 @@ namespace OpenRA.Mods.RA
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);
// Todo: Do we even need to reenable this since cost = 100% for everything?
//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, 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);
// Todo: Do we even need to reenable this since cost = 100% for everything?
//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;
}