aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hdb/ai-waypoint.cpp15
-rw-r--r--engines/hdb/ai.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/engines/hdb/ai-waypoint.cpp b/engines/hdb/ai-waypoint.cpp
index 3887b972b8..ee053ed6a4 100644
--- a/engines/hdb/ai-waypoint.cpp
+++ b/engines/hdb/ai-waypoint.cpp
@@ -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;
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index a9b1b8601e..67db4bbcbe 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -664,6 +664,7 @@ public:
// Waypoint & Movement Functions
void lookAtXY(int x, int y);
+ void removeFirstWaypoint();
void clearWaypoints();
Tile *getStandFrameDir(AIEntity *e);