From 67fa07965841a1682b246eacf57ea52afa22061f Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 21 Sep 2010 21:05:28 +1200 Subject: [PATCH] more debug --- OpenRA.Game/Traits/Util.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Traits/Util.cs b/OpenRA.Game/Traits/Util.cs index 92cbf92377..27a080074e 100755 --- a/OpenRA.Game/Traits/Util.cs +++ b/OpenRA.Game/Traits/Util.cs @@ -32,9 +32,9 @@ namespace OpenRA.Traits static float2[] fvecs = Graphics.Util.MakeArray( 32, i => -float2.FromAngle( i / 16.0f * (float)Math.PI ) * new float2( 1f, 1.3f ) ); - public static int GetFacing( float2 d, int currentFacing ) + public static int _GetFacing( float2 d, int currentFacing ) { - if( float2.WithinEpsilon( d, float2.Zero, 0.001f ) ) + if (float2.WithinEpsilon(d, float2.Zero, 0.001f)) return currentFacing; int highest = -1; @@ -53,6 +53,13 @@ namespace OpenRA.Traits return highest * 8; } + public static int GetFacing(float2 d, int currentFacing) + { + var result = _GetFacing(d, currentFacing); + Log.Write("debug", "GetFacing {0} {1} => {2}", d, currentFacing, result); + return result; + } + public static int GetNearestFacing( int facing, int desiredFacing ) { var turn = desiredFacing - facing;