GRIFFON: fix invalid mem access / crash

This can be triggered by walking 1 screen left and 1 screen down from the start.

When loading a new map the game resets only onMap for all members of the _npcInfo array, but does not always check that value when iterating over the (valid and invalid) entries of the array.
This commit is contained in:
athrxx 2021-02-26 14:48:10 +01:00
parent 3b4515b337
commit 715c9f6993

View File

@ -109,6 +109,9 @@ void GriffonEngine::updateY() {
_lasty = 0;
for (int i = 1; i <= _lastNpc; i++) {
if (!_npcInfo[i].onMap)
continue;
int yy = (int)(_npcInfo[i].y * 10);
do {