diff options
author | D G Turner | 2012-07-26 10:22:54 +0100 |
---|---|---|
committer | D G Turner | 2012-07-26 10:22:54 +0100 |
commit | cce5d3e30ff45ac85b7bb7320c3877ce6f627113 (patch) | |
tree | 1aed54c2e938353e3f694e02bba1f2be1af892d3 | |
parent | f137c75e4619d5ae8a103bfb800018da38d0c552 (diff) | |
download | scummvm-rg350-cce5d3e30ff45ac85b7bb7320c3877ce6f627113.tar.gz scummvm-rg350-cce5d3e30ff45ac85b7bb7320c3877ce6f627113.tar.bz2 scummvm-rg350-cce5d3e30ff45ac85b7bb7320c3877ce6f627113.zip |
TEENAGENT: Migrate mansion intrusion callback lookup table to switch.
-rw-r--r-- | engines/teenagent/callbacks.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index f1dcf142d4..f94f1b43c5 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -312,15 +312,32 @@ bool TeenAgentEngine::fnMansionIntrusionAttempt() { if (attempts >= 7) return false; else { - uint16 ptr = res->dseg.get_word((attempts - 2) * 2 + dsAddr_MansionIntrusionFnPtr); - debugC(0, kDebugCallbacks, "mansion callback = %04x", ptr); byte id = scene->getId(); playMusic(11); displayCutsceneMessage(dsAddr_cutsceneMsg2, 84, 95); // "Meanwhile in the mansion" - processCallback(ptr); + switch (attempts) { + case 2: + processCallback(0x9d90); + break; + case 3: + processCallback(0x9de5); + break; + case 4: + processCallback(0x9e54); + break; + case 5: + processCallback(0x9ec3); + break; + case 6: + processCallback(0x9f3e); + break; + default: + error("mansion intrusion attempts out of range!"); + break; + } playMusic(6); - if (getFlag(0xdbec) != 1 || ptr != 0x9f3e) // ptr check eq. scene_id == 11 || attempt == 6 + if (getFlag(0xdbec) != 1 || attempts != 6) loadScene(id, scene->getPosition()); return true; } |