ZVISION: Properly handle sounds reusing the same sound slot (bug #6761)

This is based on Marisa-Chan's observations in commit 28e27ea1d9.
Tested with both ZNEM and ZGI
This commit is contained in:
Filippos Karapetis 2015-01-16 14:08:15 +02:00
parent 3fe7c645ed
commit 9f00880aa4

View File

@ -486,6 +486,11 @@ ActionMusic::~ActionMusic() {
}
bool ActionMusic::execute() {
if (_engine->getScriptManager()->getSideFX(_slotKey)) {
_engine->getScriptManager()->killSideFx(_slotKey);
_engine->getScriptManager()->setStateValue(_slotKey, 2);
}
if (_midi) {
_engine->getScriptManager()->addSideFX(new MusicMidiNode(_engine, _slotKey, _prog, _note, _volume));
} else {