SCI32: Fix Phant2 "auto-save"

The game has a feature where it will automatically create a save
game when you quit the game through the in-game control panel (or
when you die, for some reason).

Unfortunately, due to bad programming, this automatic save would
just overwrite whatever was in save slot 1 (slot 0 in the original
interpreter). Find this attempt to auto-save the game and redirect
it to the auto-save slot. This might not be totally correct, but
it is at least better than destroying a save game.

Fixes Trac#10201.
This commit is contained in:
Colin Snover 2017-09-14 20:42:42 -05:00
parent 88420970b7
commit 029eeeb803
6 changed files with 26 additions and 14 deletions

View file

@ -423,4 +423,16 @@ SciCallOrigin EngineState::getCurrentCallOrigin() const {
return reply;
}
bool EngineState::callInStack(const reg_t object, const Selector selector) const {
Common::List<ExecStack>::const_iterator it;
for (it = _executionStack.begin(); it != _executionStack.end(); ++it) {
const ExecStack &call = *it;
if (call.sendp == object && call.debugSelector == selector) {
return true;
}
}
return false;
}
} // End of namespace Sci