aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cge2')
-rw-r--r--engines/cge2/snail.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index 73d29cd59f..f00b02c7bd 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -104,7 +104,7 @@ void CommandHandler::runCommand() {
}
++_tail;
_vm->_taken = false;
- Sprite *spr;
+ Sprite *spr = nullptr;
if (tailCmd._commandType > kCmdSpr)
spr = (tailCmd._ref < 0) ? ((Sprite *)tailCmd._spritePtr) : _vm->locate(tailCmd._ref);
@@ -314,7 +314,7 @@ void CommandHandler::runCommand() {
break;
}
- if (_vm->_taken)
+ if (_vm->_taken && spr)
_vm->_spare->dispose(spr);
if (!_turbo)