Remove CVec -> WVec conversion.
This commit is contained in:
@@ -44,8 +44,6 @@ namespace OpenRA
|
||||
public int LengthSquared { get { return X * X + Y * Y; } }
|
||||
public int Length { get { return (int)Math.Sqrt(LengthSquared); } }
|
||||
|
||||
public WVec ToWVec() { return new WVec(X*1024, Y*1024, 0); }
|
||||
|
||||
public CVec Clamp(Rectangle r)
|
||||
{
|
||||
return new CVec(
|
||||
@@ -115,7 +113,6 @@ namespace OpenRA
|
||||
{
|
||||
case "X": return X;
|
||||
case "Y": return Y;
|
||||
case "Facing": return Traits.Util.GetFacing(this, 0);
|
||||
default: throw new LuaException("CVec does not define a member '{0}'".F(key));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,6 +476,11 @@ namespace OpenRA
|
||||
return new CPos(pos.X / 1024, pos.Y / 1024);
|
||||
}
|
||||
|
||||
public int FacingBetween(CPos cell, CPos towards, int fallbackfacing)
|
||||
{
|
||||
return Traits.Util.GetFacing(CenterOfCell(towards) - CenterOfCell(cell), fallbackfacing);
|
||||
}
|
||||
|
||||
public void Resize(int width, int height) // editor magic.
|
||||
{
|
||||
var oldMapTiles = MapTiles.Value;
|
||||
|
||||
@@ -42,11 +42,6 @@ namespace OpenRA.Traits
|
||||
return (angle / 4 - 0x40) & 0xFF;
|
||||
}
|
||||
|
||||
public static int GetFacing(CVec d, int currentFacing)
|
||||
{
|
||||
return GetFacing(d.ToWVec(), currentFacing);
|
||||
}
|
||||
|
||||
public static int GetNearestFacing(int facing, int desiredFacing)
|
||||
{
|
||||
var turn = desiredFacing - facing;
|
||||
|
||||
Reference in New Issue
Block a user