If I understand cyx correctly, this is the proper fix for bug #1253171,

even though I thought it looked a bit hackish when I proposed it.

svn-id: r18687
This commit is contained in:
Torbjörn Andersson 2005-08-14 20:46:02 +00:00
parent 251e158e2b
commit 5cca832a85

View File

@ -793,6 +793,16 @@ byte *ResourceManager::createResource(int type, int idx, uint32 size) {
if (!validateResource("allocating", type, idx))
return NULL;
if (_vm->_version <= 2) {
// Nuking and reloading a resource can be harmful in some
// cases. For instance, Zak tries to reload the intro music
// while it's playing. See bug #1253171.
if (address[type][idx] && (type == rtSound || type == rtScript || type == rtCostume))
return address[type][idx] + sizeof(MemBlkHeader);
}
nukeResource(type, idx);
expireResources(size);