aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-04-16 22:03:18 -0400
committerPaul Gilbert2014-04-16 22:03:18 -0400
commit73a505543829c5da58f7ac31f3a9ab87f0f8b93a (patch)
treed03086e9c16173d7eafb9087a0c8a6728f20026b /engines
parentcfd49436478c356c7a9baf320d3ae86dc8485361 (diff)
downloadscummvm-rg350-73a505543829c5da58f7ac31f3a9ab87f0f8b93a.tar.gz
scummvm-rg350-73a505543829c5da58f7ac31f3a9ab87f0f8b93a.tar.bz2
scummvm-rg350-73a505543829c5da58f7ac31f3a9ab87f0f8b93a.zip
MADS: Fix unloading animations with associated messages
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/animation.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index dd7977225f..b2c257332e 100644
--- a/engines/mads/animation.cpp
+++ b/engines/mads/animation.cpp
@@ -188,7 +188,8 @@ void Animation::free() {
// Remove any kernel messages in use by the animation
for (uint i = 0; i < _messages.size(); ++i) {
int msgIndex = _messages[i]._kernelMsgIndex;
- scene._kernelMessages.remove(msgIndex);
+ if (msgIndex >= 0)
+ scene._kernelMessages.remove(msgIndex);
}
_resetFlag = false;