aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2014-07-29 16:41:56 +0200
committeruruk2014-07-29 16:41:56 +0200
commit4e32736e44a7bd90e34608d2ec7764b2ed260f52 (patch)
tree7f6b7b2ae14e355d7809295c08ce0210b7df2f58 /engines
parentfc8f6d9cfef1345774ef3dc4a0193033597a4b04 (diff)
downloadscummvm-rg350-4e32736e44a7bd90e34608d2ec7764b2ed260f52.tar.gz
scummvm-rg350-4e32736e44a7bd90e34608d2ec7764b2ed260f52.tar.bz2
scummvm-rg350-4e32736e44a7bd90e34608d2ec7764b2ed260f52.zip
CGE2: Prevent the engine from entering an endless loop when loading.
Also remove CommandHandler::reset(), since it's not useful anymore.
Diffstat (limited to 'engines')
-rw-r--r--engines/cge2/saveload.cpp3
-rw-r--r--engines/cge2/snail.cpp4
-rw-r--r--engines/cge2/snail.h1
3 files changed, 2 insertions, 6 deletions
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);