aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-16 19:03:07 +0200
committerEugene Sandulenko2019-09-03 17:17:21 +0200
commit6789a868f0f390534ad0ce282344266e032a5f0a (patch)
treef3764225d13c3623eef665c2d41bac6a291395a1
parent6fdd336ae4a4cae45976fd4087fdb7071ea5a8fc (diff)
downloadscummvm-rg350-6789a868f0f390534ad0ce282344266e032a5f0a.tar.gz
scummvm-rg350-6789a868f0f390534ad0ce282344266e032a5f0a.tar.bz2
scummvm-rg350-6789a868f0f390534ad0ce282344266e032a5f0a.zip
HDB: Fix copy-paste error in AI::legalMove()
This led to inability to move over entities on level2 while they're on level1
-rw-r--r--engines/hdb/ai-funcs.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp
index 218add0cdb..38df8ce3fa 100644
--- a/engines/hdb/ai-funcs.cpp
+++ b/engines/hdb/ai-funcs.cpp
@@ -1962,15 +1962,16 @@ AIEntity *AI::legalMove(int tileX, int tileY, int level, int *result) {
uint32 fgFlags = g_hdb->_map->getMapFGTileFlags(tileX, tileY);
AIEntity *hit = findEntity(tileX, tileY);
- if (hit && hit->state != STATE_FLOATING)
+ if (hit && hit->state != STATE_FLOATING) {
// If player and entity are not at the same level, are they on stairs?
if (hit->level != level) {
if (level == 1 && !(bgFlags & kFlagStairTop)) {
hit = NULL;
- } else if (level == 1 && !(bgFlags & kFlagStairBot)) {
+ } else if (level == 2 && !(bgFlags & kFlagStairBot)) {
hit = NULL;
}
}
+ }
if (level == 1) {
if (bgFlags & kFlagSolid) {