This commit is contained in:
Charles 2001-08-07 19:45:40 +00:00
parent 91231221c5
commit 8407047a70
4 changed files with 74 additions and 29 deletions

View file

@ -69,7 +69,7 @@ void CNpcPath::initPath()
reversePath = false;
minX = maxX = minY = maxY = 0;
waypointPtr = NULL;
decLockout = false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -77,6 +77,7 @@ void CNpcPath::initPath()
void CNpcPath::resetPath()
{
lastWaypoint = currentWaypoint = 0;
decLockout = false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -168,6 +169,8 @@ void CNpcPath::setPathExtents()
bool CNpcPath::incPath()
{
decLockout = false;
if ( !reversePath )
{
if ( currentWaypoint < waypointCount )
@ -233,18 +236,27 @@ bool CNpcPath::incPath()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPath::decPath()
bool CNpcPath::decPath()
{
if ( currentWaypoint > 0 )
if ( !decLockout )
{
lastWaypoint = currentWaypoint;
currentWaypoint--;
}
else
{
lastWaypoint = currentWaypoint;
currentWaypoint = waypointCount;
if ( currentWaypoint > 0 )
{
lastWaypoint = currentWaypoint;
currentWaypoint--;
}
else
{
lastWaypoint = currentWaypoint;
currentWaypoint = waypointCount;
}
decLockout = true;
return( true );
}
return( false );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////