diff options
author | uruk | 2014-05-24 00:11:43 +0200 |
---|---|---|
committer | uruk | 2014-05-24 00:11:43 +0200 |
commit | eb800807849989fc44f85ec2113520e868c4f7a8 (patch) | |
tree | 7763c3f0cb938580c58417b27119774e21b93898 | |
parent | 947f4b860759940dfc6420ca84870b210b1253c5 (diff) | |
download | scummvm-rg350-eb800807849989fc44f85ec2113520e868c4f7a8.tar.gz scummvm-rg350-eb800807849989fc44f85ec2113520e868c4f7a8.tar.bz2 scummvm-rg350-eb800807849989fc44f85ec2113520e868c4f7a8.zip |
CGE2: Some refactoring and fixing regarding runCommand().
-rw-r--r-- | engines/cge2/cge2.cpp | 4 | ||||
-rw-r--r-- | engines/cge2/snail.cpp | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp index e15e096d9f..ef4646194e 100644 --- a/engines/cge2/cge2.cpp +++ b/engines/cge2/cge2.cpp @@ -97,7 +97,6 @@ void CGE2Engine::init() { _commandHandlerTurbo = new CommandHandler(this, true); _infoLine = new InfoLine(this, kInfoW); _mouse = new Mouse(this); - _talk = new Talk(this); for (int i = 0; i < kMaxPoint; i++) _point[i] = new V3D(); } @@ -124,7 +123,8 @@ void CGE2Engine::deinit() { delete _commandHandlerTurbo; delete _infoLine; delete _mouse; - delete _talk; + if (_talk != nullptr) + delete _talk; for (int i = 0; i < kMaxPoint; i++) { delete _point[i]; } diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index 052188c6e0..ad643ac724 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -90,15 +90,14 @@ void CommandHandler::runCommand() { // Delay is finished _timerExpiry = 0; - } else { - if (_textDelay) { - if (_vm->_talk) { - _vm->snKill((Sprite *)_vm->_talk); - _vm->_talk = nullptr; - } - _textDelay = false; + } else if (_textDelay) { + if (_vm->_talk) { + _vm->snKill((Sprite *)_vm->_talk); + _vm->_talk = nullptr; } + _textDelay = false; } + if (_vm->_talk && tailCmd._commandType != kCmdPause) break; } |