aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/ai-waypoint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hdb/ai-waypoint.cpp')
-rw-r--r--engines/hdb/ai-waypoint.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/hdb/ai-waypoint.cpp b/engines/hdb/ai-waypoint.cpp
index ee053ed6a4..9faa88c8db 100644
--- a/engines/hdb/ai-waypoint.cpp
+++ b/engines/hdb/ai-waypoint.cpp
@@ -24,6 +24,33 @@
namespace HDB {
+void AI::addWaypoint(int px, int py, int x, int y, int level) {
+ if (_numWaypoints >= kMaxWaypoints || (playerOnIce() && _player->goalX))
+ return;
+
+ // Check for duplicates
+ for (int i = 0;i < _numWaypoints;i++)
+ if (_waypoints[i].x == x && _waypoints[i].y == y)
+ return;
+
+ // Check if path is clear
+ int nx = x;
+ int ny = y;
+ if (!_numWaypoints) {
+ warning("STUB: addWaypoint: Setup First Waypoint");
+ } else {
+ warning("STUB: addWaypoint: Setup additional Waypoints");
+ }
+
+ if (_numWaypoints < kMaxWaypoints) {
+ _waypoints[_numWaypoints].x = nx;
+ _waypoints[_numWaypoints].y = ny;
+ _waypoints[_numWaypoints].level = level;
+ _numWaypoints++;
+ warning("STUB: addWaypoint: Play SND_MENU_SLIDER");
+ }
+}
+
void AI::removeFirstWaypoint() {
if (!_numWaypoints)
return;