From c551115b4b31e653cc046b6ea91fd306e6b8dc5e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 Jun 2014 09:30:10 -0400 Subject: MADS: Fix memory corruption when dealing with monster in scene 703 --- engines/mads/animation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/mads/animation.cpp') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index 6af8a9ae5f..512a3979f9 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -310,8 +310,10 @@ void Animation::load(UserInterface &interfaceSurface, DepthSurface &depthSurface for (int idx = 0; idx < _header._spriteSetsCount; ++idx) usageList.push_back(_spriteSets[idx]->_usageIndex); - if (usageList.size() > 0) - _vm->_palette->_paletteUsage.updateUsage(usageList, _header._messagesCount); + if (usageList.size() > 0) { + int spritesUsageIndex = _spriteSets[0]->_usageIndex; + _vm->_palette->_paletteUsage.updateUsage(usageList, spritesUsageIndex); + } // Remaps the sprite list indexes for frames to the loaded sprite list indexes for (uint i = 0; i < _frameEntries.size(); ++i) { -- cgit v1.2.3