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

@ -28,11 +28,12 @@ void CNpcLinearPlatform::processMovement( int _frames )
{
s32 moveX = 0, moveY = 0;
s32 moveDist = 0;
s32 xDist, yDist;
bool pathComplete;
bool waypointChange;
s16 headingToTarget = m_npcPath.think( Pos, &pathComplete, &waypointChange );
s16 headingToTarget = m_npcPath.think( Pos, &pathComplete, &waypointChange, &xDist, &yDist );
if ( !pathComplete )
{
@ -83,12 +84,50 @@ void CNpcLinearPlatform::processMovement( int _frames )
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;
}
//processGroundCollisionReverse( moveX, moveY );
}