[Scummvm-git-logs] scummvm master -> a7f063e867b4313c5417d7c5a69f6997b5aa1b19
antoniou79
noreply at scummvm.org
Fri Dec 26 17:15:54 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
a7f063e867 HDB: Complete move entity command for deleted entity
Commit: a7f063e867b4313c5417d7c5a69f6997b5aa1b19
https://github.com/scummvm/scummvm/commit/a7f063e867b4313c5417d7c5a69f6997b5aa1b19
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2025-12-26T19:15:41+02:00
Commit Message:
HDB: Complete move entity command for deleted entity
Fixes bug #16421
Changed paths:
engines/hdb/ai-cinematic.cpp
diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp
index 25619ec7018..4eba7a5aba3 100644
--- a/engines/hdb/ai-cinematic.cpp
+++ b/engines/hdb/ai-cinematic.cpp
@@ -212,12 +212,26 @@ void AI::processCines() {
_cine[i]->e->level = (int)_cine[i]->x2;
setEntityGoal(_cine[i]->e, (int)_cine[i]->x, (int)_cine[i]->y);
_cine[i]->start = 1;
- } else
+ } else {
warning("Can't locate '%s' in moveEntity", _cine[i]->title);
+ // If the entity can't be found, we consider this cinematic command completed
+ complete = true;
+ }
} else {
- debug(3, "C_MOVEENTITY: %d, %s tileX: %d, goalX: %d tileY %d, goalY: %d", i, AIType2Str(_cine[i]->e->type), _cine[i]->e->tileX, _cine[i]->e->goalX, _cine[i]->e->tileY, _cine[i]->e->goalY);
- if (!_cine[i]->e->goalX)
+ // Fix for bug #16421
+ // Ensure that the entity _cine[i]->e still exists,
+ // because it could have been removed, eg. if Guy shoots the chicken in Map 10
+ AIEntity *e = locateEntity(_cine[i]->title);
+ if (e) {
+ _cine[i]->e = e;
+ debug(3, "C_MOVEENTITY: %d, %s tileX: %d, goalX: %d tileY %d, goalY: %d", i, AIType2Str(_cine[i]->e->type), _cine[i]->e->tileX, _cine[i]->e->goalX, _cine[i]->e->tileY, _cine[i]->e->goalY);
+ if (!_cine[i]->e->goalX)
+ complete = true;
+ } else {
+ warning("Can't locate '%s' in moveEntity (_cine[%d]->start=%d)", _cine[i]->title, i, _cine[i]->start);
+ // If the entity can't be found, we consider this cinematic command completed
complete = true;
+ }
}
break;
case C_ANIMENTITY:
More information about the Scummvm-git-logs
mailing list