From 37756c9ffeabcf2dfc91b2dce36dc928d580ce3d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 27 Nov 2011 22:16:52 +1100 Subject: CGE: Better fix for restoring savegames when a cut-scene is active --- engines/cge/cge.cpp | 3 +-- engines/cge/cge_main.cpp | 1 + engines/cge/snail.cpp | 4 ++++ engines/cge/snail.h | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/cge') diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index 8e74253f86..87654c53f4 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -208,8 +208,7 @@ bool CGEEngine::hasFeature(EngineFeature f) const { } bool CGEEngine::canLoadGameStateCurrently() { - return (_startupMode == 0) && _mouse->_active && - _commandHandler->idle() && !_hero->_flags._hide; + return (_startupMode == 0) && _mouse->_active; } bool CGEEngine::canSaveGameStateCurrently() { diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index e5831400ee..01bd037315 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -292,6 +292,7 @@ Common::Error CGEEngine::loadGameState(int slot) { void CGEEngine::resetGame() { _vga->_spareQ->clear(); + _commandHandler->reset(); } Common::Error CGEEngine::saveGameState(int slot, const Common::String &desc) { diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp index 5ab8f6314b..9db5406c25 100644 --- a/engines/cge/snail.cpp +++ b/engines/cge/snail.cpp @@ -375,6 +375,10 @@ bool CommandHandler::idle() { return (_head == _tail); } +void CommandHandler::reset() { + _tail = _head; +} + /** * Handles mini-Games logic * @param com Command diff --git a/engines/cge/snail.h b/engines/cge/snail.h index 6749d6bcc8..6a9e717441 100644 --- a/engines/cge/snail.h +++ b/engines/cge/snail.h @@ -70,6 +70,7 @@ public: void addCallback(CommandType com, int ref, int val, CallbackType cbType); void insertCommand(CommandType com, int ref, int val, void *ptr); bool idle(); + void reset(); private: CGEEngine *_vm; bool _turbo; -- cgit v1.2.3