diff options
-rw-r--r-- | engines/hdb/ai-inventory.cpp | 37 | ||||
-rw-r--r-- | engines/hdb/ai.h | 10 |
2 files changed, 47 insertions, 0 deletions
diff --git a/engines/hdb/ai-inventory.cpp b/engines/hdb/ai-inventory.cpp index 09fee3b5b8..cfa45e342f 100644 --- a/engines/hdb/ai-inventory.cpp +++ b/engines/hdb/ai-inventory.cpp @@ -104,4 +104,41 @@ AIEntity *AI::getInvItem(int which) { return NULL; return _inventory[which].ent; } + +void AI::newDelivery(const char *itemTextName, const char *itemGfxName, const char *destTextName, const char *destGfxName, const char *id) { + int i = _numDeliveries; + + if (i == kMaxDeliveries) { + g_hdb->_window->openMessageBar("You have too many deliveries already!", 3); + return; + } + + if (itemTextName) + strcpy(_deliveries[i].itemTextName, itemTextName); + if (itemGfxName) + strcpy(_deliveries[i].itemGfxName, itemGfxName); + if (destTextName) + strcpy(_deliveries[i].destTextName, destTextName); + if (destGfxName) + strcpy(_deliveries[i].destGfxName, destGfxName); + + strcpy(_deliveries[i].id, id); + + _numDeliveries++; + + g_hdb->_window->openDeliveries(true); +} + +bool AI::completeDelivery(const char *id) { + for (int i = 0; i < _numDeliveries; i++) + if (!scumm_stricmp(_deliveries[i].id, id)) { + for (; i < _numDeliveries; i++) + memcpy(&_deliveries[i], &_deliveries[i + 1], sizeof(_deliveries[0])); + _numDeliveries--; + warning("STUB: Play Voice: GUY_COMPLETED"); + return true; + } + return false; +} + } // End of Namespace diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 41337082f1..40be5af840 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -935,6 +935,16 @@ public: AIEntity *getInvItem(int which); + // Delivery Functions + void newDelivery(const char *itemTextName, const char *itemGfxName, const char *destTextName, const char *destGfxName, const char *id); + int getDeliveriesAmount() { + return _numDeliveries; + } + DlvEnt *getDeliveryItem(int which) { + return &_deliveries[which]; + } + bool completeDelivery(const char *id); + // Player Variables bool _playerDead; bool _playerInvisible; // While on RailRider for example |