This commit is contained in:
parent
952fb82287
commit
f613848385
27 changed files with 552 additions and 730 deletions
|
@ -73,12 +73,42 @@ void CNpcEnemy::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32
|
|||
moveX = preShiftX / abs( preShiftX );
|
||||
}
|
||||
|
||||
if ( xDist > 0 )
|
||||
{
|
||||
if ( moveX > xDist )
|
||||
{
|
||||
moveX = xDist;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( moveX < xDist )
|
||||
{
|
||||
moveX = xDist;
|
||||
}
|
||||
}
|
||||
|
||||
moveY = preShiftY >> 12;
|
||||
if ( !moveY && preShiftY )
|
||||
{
|
||||
moveY = preShiftY / abs( preShiftY );
|
||||
}
|
||||
|
||||
if ( yDist > 0 )
|
||||
{
|
||||
if ( moveY > yDist )
|
||||
{
|
||||
moveY = yDist;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( moveY < yDist )
|
||||
{
|
||||
moveY = yDist;
|
||||
}
|
||||
}
|
||||
|
||||
Pos.vx += moveX;
|
||||
Pos.vy += moveY;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue