diff options
author | Evgeny Grechnikov | 2018-09-11 23:14:30 +0300 |
---|---|---|
committer | Evgeny Grechnikov | 2018-09-11 23:14:30 +0300 |
commit | 0cb6b30f67bada2626cbffb8dc0c83c80f3eda63 (patch) | |
tree | 1b28335e2829c45b30c5da41dbf5f4d5c0a5d718 /engines/lastexpress/entities/francois.cpp | |
parent | 4d36385ccb1fb35b062360193b41ef589d150039 (diff) | |
download | scummvm-rg350-0cb6b30f67bada2626cbffb8dc0c83c80f3eda63.tar.gz scummvm-rg350-0cb6b30f67bada2626cbffb8dc0c83c80f3eda63.tar.bz2 scummvm-rg350-0cb6b30f67bada2626cbffb8dc0c83c80f3eda63.zip |
LASTEXPRESS: more fixes in NPC logic
Diffstat (limited to 'engines/lastexpress/entities/francois.cpp')
-rw-r--r-- | engines/lastexpress/entities/francois.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/engines/lastexpress/entities/francois.cpp b/engines/lastexpress/entities/francois.cpp index 9eb12fbfce..be95f31419 100644 --- a/engines/lastexpress/entities/francois.cpp +++ b/engines/lastexpress/entities/francois.cpp @@ -580,13 +580,13 @@ IMPLEMENT_FUNCTION(13, Francois, haremVisit) getData()->location = kLocationOutsideCompartment; setCallback(7); - setup_doWalk(kCarGreenSleeping, kPosition_4840); + setup_doWalk(kCarRedSleeping, kPosition_4840); break; case 7: if (getInventory()->hasItem(kItemWhistle) || getInventory()->get(kItemWhistle)->location == kObjectLocation3) { setCallback(10); - setup_doWalk(kCarGreenSleeping, kPosition_5790); + setup_doWalk(kCarRedSleeping, kPosition_5790); break; } @@ -605,7 +605,7 @@ IMPLEMENT_FUNCTION(13, Francois, haremVisit) getEntities()->exitCompartment(kEntityFrancois, kObjectCompartmentE, true); setCallback(10); - setup_doWalk(kCarGreenSleeping, kPosition_5790); + setup_doWalk(kCarRedSleeping, kPosition_5790); break; case 10: @@ -1151,16 +1151,18 @@ label_callback_10: label_callback_11: if (getInventory()->get(kItemBeetle)->location == kObjectLocation3) { - if (getState()->time <= kTimeEnd) - if (!getEntities()->isDistanceBetweenEntities(kEntityFrancois, kEntityPlayer, 2000) || !CURRENT_PARAM(1, 4)) - CURRENT_PARAM(1, 4) = (uint)(getState()->time + 75); - - if (CURRENT_PARAM(1, 4) < getState()->time || getState()->time > kTimeEnd) { - CURRENT_PARAM(1, 4) = kTimeInvalid; - - setCallback(12); - setup_playSound("Fra2010"); - break; + if (CURRENT_PARAM(1, 4) != kTimeInvalid) { + if (getState()->time <= kTimeEnd) + if (!getEntities()->isDistanceBetweenEntities(kEntityFrancois, kEntityPlayer, 2000) || !CURRENT_PARAM(1, 4)) + CURRENT_PARAM(1, 4) = (uint)(getState()->time + 75); + + if (CURRENT_PARAM(1, 4) < getState()->time || getState()->time > kTimeEnd) { + CURRENT_PARAM(1, 4) = kTimeInvalid; + + setCallback(12); + setup_playSound("Fra2010"); + break; + } } label_callback_12: @@ -1174,6 +1176,12 @@ label_callback_13: label_callback_14: timeCheckCallbackCompartment(kTime2218500, CURRENT_PARAM(1, 7), 15, kObjectCompartmentB, kPosition_7500, "b"); } + // The original game has some code here similar to withMama marked as BUG: + // if [kItemBeetle].location != kObjectLocation3 && !has(kItemWhistle) && [kItemWhistle].location != kObjectLocation3, + // there are several always-false checks (time < N && time > N), + // kTime2040300 with callback 16, kTime2119500 with callback 17, kTime2146500 with callback 18, kTime2218500 with callback 19, + // with takeWalk as a payload. + // No point in reproducing it here. } break; |