aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/ai-bots.cpp
diff options
context:
space:
mode:
authorNipun Garg2019-06-27 02:15:09 +0530
committerEugene Sandulenko2019-09-03 17:17:01 +0200
commit407c1913cc6f2327ee0721a5daa8c80b8dd8f98b (patch)
treec5a005a2555929ad514699ca1d4bb2557dbb58e0 /engines/hdb/ai-bots.cpp
parentd3c2c935a52d59a088feaa82a3ac46fc356c8267 (diff)
downloadscummvm-rg350-407c1913cc6f2327ee0721a5daa8c80b8dd8f98b.tar.gz
scummvm-rg350-407c1913cc6f2327ee0721a5daa8c80b8dd8f98b.tar.bz2
scummvm-rg350-407c1913cc6f2327ee0721a5daa8c80b8dd8f98b.zip
HDB: Replace booleans with macro function
Diffstat (limited to 'engines/hdb/ai-bots.cpp')
-rw-r--r--engines/hdb/ai-bots.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/hdb/ai-bots.cpp b/engines/hdb/ai-bots.cpp
index f7c6cbce12..b86cd4a324 100644
--- a/engines/hdb/ai-bots.cpp
+++ b/engines/hdb/ai-bots.cpp
@@ -53,7 +53,7 @@ void aiOmniBotAction(AIEntity *e) {
if (!e->sequence) {
g_hdb->_ai->animateEntity(e);
// Is the Player collding?
- if (e->onScreen && (p->level = e->level) && g_hdb->_ai->checkPlayerCollision(e->x, e->y, 4) && !g_hdb->_ai->playerDead()) {
+ if (hitPlayer(e->x, e->y) && (p->level == e->level)) {
g_hdb->_ai->killPlayer(DEATH_FRIED);
return;
}
@@ -162,7 +162,7 @@ void aiOmniBotMissileAction(AIEntity *e) {
// On Even tiles, check for hitting player
if (onEvenTile(e->x, e->y))
- if (e->onScreen && (p->level == e->level) && g_hdb->_ai->checkPlayerCollision(e->x, e->y, 4) && !g_hdb->_ai->playerDead()) {
+ if (hitPlayer(e->x, e->y) && (p->level == e->level)) {
g_hdb->_ai->killPlayer(DEATH_NORMAL);
g_hdb->_ai->addAnimateTarget(e->x, e->y, 0, 3, ANIM_FAST, false, false, "steam_puff_sit");
g_hdb->_ai->removeEntity(e);
@@ -241,7 +241,7 @@ void aiShockBotInit2(AIEntity *e) {
void aiShockBotAction(AIEntity *e) {
if (e->goalX) {
if (!e->sequence) {
- if (e->onScreen && g_hdb->_ai->checkPlayerCollision(e->x, e->y, 4) && !g_hdb->_ai->playerDead())
+ if (hitPlayer(e->x, e->y))
g_hdb->_ai->killPlayer(DEATH_SHOCKED);
g_hdb->_ai->animateEntity(e);
} else
@@ -488,10 +488,10 @@ void aiPushBotAction(AIEntity *e) {
if (e->goalX) {
g_hdb->_ai->animateEntity(e);
- if (e->onScreen && g_hdb->_ai->checkPlayerCollision(e->x, e->y, 4) && !g_hdb->_ai->playerDead())
+ if (hitPlayer(e->x, e->y))
g_hdb->_ai->killPlayer(DEATH_NORMAL);
} else {
- if (e->onScreen && g_hdb->_ai->checkPlayerCollision(e->x, e->y, 4) && !g_hdb->_ai->playerDead())
+ if (hitPlayer(e->x, e->y))
g_hdb->_ai->killPlayer(DEATH_NORMAL);
// Where to go next
@@ -916,7 +916,7 @@ void aiMaintBotAction(AIEntity *e) {
// Moving already, keep going
if (e->goalX) {
g_hdb->_ai->animateEntity(e);
- if (e->onScreen && g_hdb->_ai->checkPlayerCollision(e->x, e->y, 4) && !g_hdb->_ai->playerDead()) {
+ if (hitPlayer(e->x, e->y)) {
g_hdb->_ai->killPlayer(DEATH_GRABBED);
warning("STUB: aiMaintBotAction: Play SND_MBOT_DEATH");
}