HDB: Add removeFirstWaypoint()

This commit is contained in:
Nipun Garg 2019-06-21 21:25:40 +05:30 committed by Eugene Sandulenko
parent 755bd46728
commit bf98bcca01
2 changed files with 16 additions and 0 deletions

View File

@ -24,6 +24,21 @@
namespace HDB {
void AI::removeFirstWaypoint() {
if (!_numWaypoints)
return;
int i;
for (i = 0;i < _numWaypoints;i++) {
_waypoints[i] = _waypoints[i + 1];
}
_waypoints[i].x = 0;
_waypoints[i].y = 0;
_waypoints[i].level = 0;
_numWaypoints--;
}
void AI::clearWaypoints() {
memset(&_waypoints[0], 0, sizeof(_waypoints));
_numWaypoints = 0;

View File

@ -664,6 +664,7 @@ public:
// Waypoint & Movement Functions
void lookAtXY(int x, int y);
void removeFirstWaypoint();
void clearWaypoints();
Tile *getStandFrameDir(AIEntity *e);