From 64cd74d1b2c728696ce9e475dc6e883f1a48e1fe Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Fri, 5 Jul 2019 00:07:08 +0530 Subject: HDB: Add aiDiverterAction() --- engines/hdb/ai-bots.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/hdb/ai-bots.cpp b/engines/hdb/ai-bots.cpp index f0b6f35aa2..628a14777b 100644 --- a/engines/hdb/ai-bots.cpp +++ b/engines/hdb/ai-bots.cpp @@ -1264,7 +1264,19 @@ void aiDiverterInit2(AIEntity *e) { } void aiDiverterAction(AIEntity *e) { - warning("STUB: AI: aiDiverterAction required"); + if (e->goalX) { + g_hdb->_ai->animateEntity(e); + warning("STUB: Set Laser Rescan to true"); + + // have to reset the state because we might have been moved... + switch (e->dir2) { + case DIR_DOWN: e->state = STATE_DIVERTER_BL; e->draw = e->standdownGfx[0]; break; + case DIR_UP: e->state = STATE_DIVERTER_BR; e->draw = e->standupGfx[0]; break; + case DIR_LEFT: e->state = STATE_DIVERTER_TL; e->draw = e->standleftGfx[0]; break; + case DIR_RIGHT: e->state = STATE_DIVERTER_TR; e->draw = e->standrightGfx[0]; break; + case DIR_NONE: break; + } + } } void aiDiverterDraw(AIEntity *e, int mx, int my) { -- cgit v1.2.3