git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1281 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -85,19 +85,13 @@ namespace OpenRa.Game
|
|||||||
float2 d = ( currentOrder.Destination - location ).Constrain( r );
|
float2 d = ( currentOrder.Destination - location ).Constrain( r );
|
||||||
|
|
||||||
int desiredFacing = GetFacing( d );
|
int desiredFacing = GetFacing( d );
|
||||||
if (desiredFacing == facing)
|
int df = (desiredFacing - facing + 32) % 32;
|
||||||
|
if( df == 0 )
|
||||||
location += d;
|
location += d;
|
||||||
else
|
else if( df > 16 )
|
||||||
{
|
|
||||||
int df = desiredFacing - facing;
|
|
||||||
if (df < 0)
|
|
||||||
df = 32 - df;
|
|
||||||
|
|
||||||
if (df < 32 - df)
|
|
||||||
facing = (facing + 1) % 32;
|
|
||||||
else
|
|
||||||
facing = ( facing + 31 ) % 32;
|
facing = ( facing + 31 ) % 32;
|
||||||
}
|
else
|
||||||
|
facing = ( facing + 1 ) % 32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,12 +37,9 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
foreach (Actor a in actors)
|
foreach (Actor a in actors)
|
||||||
{
|
{
|
||||||
Sprite[] images = a.CurrentImages;
|
|
||||||
|
|
||||||
a.Tick( dt );
|
a.Tick( dt );
|
||||||
|
|
||||||
if (images == null)
|
Sprite[] images = a.CurrentImages;
|
||||||
continue;
|
|
||||||
|
|
||||||
if( a.location.X > range.End.X || a.location.X < range.Start.X - images[ 0 ].bounds.Width )
|
if( a.location.X > range.End.X || a.location.X < range.Start.X - images[ 0 ].bounds.Width )
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user