diff options
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/ai-use.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/engines/hdb/ai-use.cpp b/engines/hdb/ai-use.cpp index bca73155d8..f48b9e620a 100644 --- a/engines/hdb/ai-use.cpp +++ b/engines/hdb/ai-use.cpp @@ -292,8 +292,19 @@ bool AI::useAutoDoorOpenClose(AIEntity *e, int x, int y) { // Any Type Door bool AI::useDoorOpenCloseBot(AIEntity *e, int x, int y) { - warning("STUB: Define useDoorOpenCloseBot"); - return false; + int tileIndex = g_hdb->_map->getMapBGTileIndex(x, y); + + if (e == _player || e->type == AI_SLUG_ATTACK || e->type == AI_GEM_ATTACK) { + if (isClosedDoor(x, y)) + g_hdb->_sound->playSound(SND_GUY_UHUH); + return false; + } + + addAnimateTarget(x, y, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, NULL); + // AddCallback( CALLBACK_DOOR_OPEN_CLOSE, x, y, DELAY_5SECONDS / fs ); + if (g_hdb->_map->onScreen(x, y)) + g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE); + return true; } } // End of Namespace |