LASTEXPRESS: multiple fixes in NPC logic

Checked the logic against the original game
(to be precise, DOS English version from GOG, although I think
AI logic has no significant differences with other versions).
Fixed a *lot* of errors with varying visibility for the user.

Also, save+exit+load sometimes resulted in memory corruption like
((EntityParametersSSII*)(new EntityParametersIIII))->param8 = 0;
load operation did not restore the correct type of NPC logic context,
the default one was used (which also has the smallest sizeof).
Should be fixed now. Save+load is still unusable because it locks
everybody waiting for kActionEndSound (the sound state is not restored),
but, at least, it should not corrupt the memory. Hopefully.
This commit is contained in:
Evgeny Grechnikov 2018-08-25 15:11:24 +03:00 committed by Eugene Sandulenko
parent f3cb1fcd84
commit f771fa40ad
47 changed files with 1313 additions and 1033 deletions

View file

@ -487,10 +487,7 @@ bool Debugger::cmdPlaySeq(int argc, const char **argv) {
// Handle right-click to interrupt sequence
Common::Event ev;
if (!_engine->getEventManager()->pollEvent(ev))
break;
if (ev.type == Common::EVENT_RBUTTONUP)
if (_engine->getEventManager()->pollEvent(ev) && ev.type == Common::EVENT_RBUTTONUP)
break;
_engine->_system->delayMillis(175);