This commit is contained in:
parent
91231221c5
commit
8407047a70
4 changed files with 74 additions and 29 deletions
|
@ -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 );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue