Simplify and fix missile turnaround facing check.

This commit is contained in:
Paul Chote
2016-04-23 17:14:04 +01:00
parent fb53890636
commit 59f5e24189
2 changed files with 10 additions and 1 deletions

View File

@@ -73,6 +73,14 @@ namespace OpenRA.Mods.Common
}
}
public static int NormalizeFacing(int f)
{
if (f >= 0)
return f & 0xFF;
return 0xFF - (-f & 0xFF);
}
public static WPos BetweenCells(World w, CPos from, CPos to)
{
return WPos.Lerp(w.Map.CenterOfCell(from), w.Map.CenterOfCell(to), 1, 2);