From 4e32736e44a7bd90e34608d2ec7764b2ed260f52 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 29 Jul 2014 16:41:56 +0200 Subject: CGE2: Prevent the engine from entering an endless loop when loading. Also remove CommandHandler::reset(), since it's not useful anymore. --- engines/cge2/saveload.cpp | 3 ++- engines/cge2/snail.cpp | 4 ---- engines/cge2/snail.h | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) (limited to 'engines/cge2') diff --git a/engines/cge2/saveload.cpp b/engines/cge2/saveload.cpp index 652dbea1ec..b984a48e57 100644 --- a/engines/cge2/saveload.cpp +++ b/engines/cge2/saveload.cpp @@ -317,6 +317,8 @@ void CGE2Engine::syncHeader(Common::Serializer &s) { } Common::Error CGE2Engine::loadGameState(int slot) { + _commandHandler->clear(); + _commandHandlerTurbo->clear(); sceneDown(); if (!loadGame(slot)) return Common::kReadingFailed; @@ -329,7 +331,6 @@ void CGE2Engine::resetGame() { busy(false); _spare->clear(); _vga->_showQ->clear(); - _commandHandler->reset(); loadScript("CGE.INI", true); delete _infoLine; _infoLine = new InfoLine(this, kInfoW); diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index 54ef036dc3..48e8ffdb70 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -749,10 +749,6 @@ bool CommandHandler::idle() { return (!_vm->_waitRef && _head == _tail); } -void CommandHandler::reset() { - _tail = _head; -} - void CommandHandler::clear() { _tail = _head; _vm->killText(); diff --git a/engines/cge2/snail.h b/engines/cge2/snail.h index 82df181878..7e618daac8 100644 --- a/engines/cge2/snail.h +++ b/engines/cge2/snail.h @@ -112,7 +112,6 @@ 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(); void clear(); int getComId(const char *com); const char *getComStr(CommandType cmdType); -- cgit v1.2.3