This commit is contained in:
Charles 2001-04-28 17:39:24 +00:00
parent b0808f3389
commit 6679878552
8 changed files with 296 additions and 73 deletions

View file

@ -80,13 +80,17 @@ void CNpcEnemy::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32
moveX = xDist;
}
}
else
else if ( xDist < 0 )
{
if ( moveX < xDist )
{
moveX = xDist;
}
}
else
{
moveX = 0;
}
moveY = preShiftY >> 12;
if ( !moveY && preShiftY )
@ -101,13 +105,17 @@ void CNpcEnemy::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32
moveY = yDist;
}
}
else
else if ( yDist < 0 )
{
if ( moveY < yDist )
{
moveY = yDist;
}
}
else
{
moveY = 0;
}
Pos.vx += moveX;
Pos.vy += moveY;
@ -188,8 +196,9 @@ void CNpcEnemy::processGenericFixedPathMove( int _frames, s32 *moveX, s32 *moveY
{
bool pathComplete;
bool waypointChange;
s32 xDist, yDist;
s16 headingToTarget = m_npcPath.think( Pos, &pathComplete, &waypointChange );
s16 headingToTarget = m_npcPath.think( Pos, &pathComplete, &waypointChange, &xDist, &yDist );
/*if ( waypointChange )
{
@ -245,12 +254,50 @@ void CNpcEnemy::processGenericFixedPathMove( int _frames, s32 *moveX, s32 *moveY
*moveX = preShiftX / abs( preShiftX );
}
if ( xDist > 0 )
{
if ( *moveX > xDist )
{
*moveX = xDist;
}
}
else if ( xDist < 0 )
{
if ( *moveX < xDist )
{
*moveX = xDist;
}
}
else
{
*moveX = 0;
}
*moveY = preShiftY >> 12;
if ( !(*moveY) && preShiftY )
{
*moveY = preShiftY / abs( preShiftY );
}
if ( yDist > 0 )
{
if ( *moveY > yDist )
{
*moveY = yDist;
}
}
else if ( yDist < 0 )
{
if ( *moveY < yDist )
{
*moveY = yDist;
}
}
else
{
*moveY = 0;
}
*moveVel = ( _frames * m_data[m_type].speed ) << 8;
//processGroundCollisionReverse( moveX, moveY );