diff options
author | Nipun Garg | 2019-06-22 08:53:59 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:55 +0200 |
commit | 2cdf2a62decddc21cbb2c5a4d10f74c55ff32c17 (patch) | |
tree | c7030ff639bde107a8edc11d31ffb9de32803af4 | |
parent | a39b9f373ca42c1ff25d2d479fee7efc071da498 (diff) | |
download | scummvm-rg350-2cdf2a62decddc21cbb2c5a4d10f74c55ff32c17.tar.gz scummvm-rg350-2cdf2a62decddc21cbb2c5a4d10f74c55ff32c17.tar.bz2 scummvm-rg350-2cdf2a62decddc21cbb2c5a4d10f74c55ff32c17.zip |
HDB: Add stubbed addWaypoint()
-rw-r--r-- | engines/hdb/ai-waypoint.cpp | 27 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 |
2 files changed, 28 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; diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index df700722e7..f67fbd7849 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -723,6 +723,7 @@ public: // Waypoint & Movement Functions void lookAtXY(int x, int y); + void addWaypoint(int px, int py, int x, int y, int level); void removeFirstWaypoint(); void clearWaypoints(); Tile *getStandFrameDir(AIEntity *e); |