This commit is contained in:
parent
a1dac87c85
commit
fedc13f51d
5 changed files with 45 additions and 2 deletions
Binary file not shown.
Binary file not shown.
|
@ -233,6 +233,22 @@ bool CNpcPath::incPath()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcPath::decPath()
|
||||
{
|
||||
if ( currentWaypoint > 0 )
|
||||
{
|
||||
lastWaypoint = currentWaypoint;
|
||||
currentWaypoint--;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastWaypoint = currentWaypoint;
|
||||
currentWaypoint = waypointCount;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcPath::reversePathDir()
|
||||
{
|
||||
if ( lastWaypoint )
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
void setPathType( u8 newPathType );
|
||||
u8 getPathType();
|
||||
bool incPath();
|
||||
void decPath();
|
||||
void resetPath();
|
||||
void reversePathDir();
|
||||
s32 think( DVECTOR currentPos, bool *pathComplete, bool *waypointChange, s32 *distX, s32 *distY );
|
||||
|
|
|
@ -555,9 +555,22 @@ void CNpcSeaSnakeEnemy::processMovement( int _frames )
|
|||
case COLLISION_TYPE_FLAG_SOLID:
|
||||
{
|
||||
Pos = oldPos;
|
||||
m_heading += 1024;
|
||||
m_heading += 2048;
|
||||
m_heading &= 4095;
|
||||
|
||||
m_npcPath.decPath();
|
||||
|
||||
DVECTOR waypointPos;
|
||||
m_npcPath.getCurrentWaypointPos( &waypointPos );
|
||||
waypointPos.vy -= 8;
|
||||
|
||||
if ( CGameScene::getCollision()->getHeightFromGround( waypointPos.vx, waypointPos.vy ) < 0 )
|
||||
{
|
||||
// one of the special 'teleport' waypoints
|
||||
|
||||
m_npcPath.incPath();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -879,9 +892,22 @@ void CNpcSeaSnakeEnemy::processClose( int _frames )
|
|||
m_sensorFunc = NPC_SENSOR_NONE;
|
||||
|
||||
Pos = oldPos;
|
||||
m_heading += 1024;
|
||||
m_heading += 2048;
|
||||
m_heading &= 4095;
|
||||
|
||||
m_npcPath.decPath();
|
||||
|
||||
DVECTOR waypointPos;
|
||||
m_npcPath.getCurrentWaypointPos( &waypointPos );
|
||||
waypointPos.vy -= 8;
|
||||
|
||||
if ( CGameScene::getCollision()->getHeightFromGround( waypointPos.vx, waypointPos.vy ) < 0 )
|
||||
{
|
||||
// one of the special 'teleport' waypoints
|
||||
|
||||
m_npcPath.incPath();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue