From 4ca49386ed933533efaed857ee4a94ce0570494b Mon Sep 17 00:00:00 2001 From: Robert Göffringmann Date: Sun, 4 Jan 2004 17:19:17 +0000 Subject: fixed cd changing code svn-id: r12145 --- sword1/sword1.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'sword1') diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp index d86cf1dc1e..9ee4c9102e 100644 --- a/sword1/sword1.cpp +++ b/sword1/sword1.cpp @@ -1085,16 +1085,24 @@ void SwordEngine::go(void) { void SwordEngine::checkCd(void) { uint8 needCd = _cdList[SwordLogic::_scriptVars[NEW_SCREEN]]; - if ((needCd == 0) && (_systemVars.currentCD == 0)) - needCd = 1; - if (needCd != _systemVars.currentCD) { - _systemVars.currentCD = needCd; - if (_systemVars.runningFromCd) { + if (needCd == 0) { + if (_systemVars.currentCD == 0) + needCd = 1; + else + needCd = _systemVars.currentCD; + } + if (_systemVars.runningFromCd) { + if (!_systemVars.currentCD) { + _systemVars.currentCD = needCd; + _control->askForCd(); + } else if (_systemVars.currentCD != needCd) { _music->startMusic(0, 0); _sound->closeCowSystem(); + _systemVars.currentCD = needCd; _control->askForCd(); } - } + } else + _systemVars.currentCD = needCd; } uint8 SwordEngine::mainLoop(void) { -- cgit v1.2.3