diff options
author | Julien Templier | 2010-10-19 20:53:43 +0000 |
---|---|---|
committer | Julien Templier | 2010-10-19 20:53:43 +0000 |
commit | 3feab382bc5c97656580254c235a5573e24e0d6f (patch) | |
tree | 0fa6d1b0b6f1e389a089dcfc512c090f2961b24c /engines | |
parent | f3becaddf1d865e44f13aadbb8c71952a73f2268 (diff) | |
download | scummvm-rg350-3feab382bc5c97656580254c235a5573e24e0d6f.tar.gz scummvm-rg350-3feab382bc5c97656580254c235a5573e24e0d6f.tar.bz2 scummvm-rg350-3feab382bc5c97656580254c235a5573e24e0d6f.zip |
LASTEXPRESS: Fix corpse disappearing when hiding the body in the bed
The setItemLocation action had a typo that prevented it from setting the item location.
The "corpse moved" event was not set and it broke the scene progression.
Also clean up the pickCorpse code and add better comments.
svn-id: r53624
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lastexpress/game/action.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index b2c7fdef1f..b90ee40c6a 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -638,18 +638,14 @@ IMPLEMENT_ACTION(setItemLocation) return kSceneInvalid; Inventory::InventoryEntry* entry = getInventory()->get(item); - if (!entry->isPresent) + if (entry->isPresent) return kSceneInvalid; entry->location = (ObjectLocation)hotspot.param2; if (item == kItemCorpse) { ObjectLocation corpseLocation = getInventory()->get(kItemCorpse)->location; - - if (corpseLocation == kObjectLocation3 || corpseLocation == kObjectLocation4) - getProgress().eventCorpseMovedFromFloor = true; - else - getProgress().eventCorpseMovedFromFloor = false; + getProgress().eventCorpseMovedFromFloor = (corpseLocation == kObjectLocation3 || corpseLocation == kObjectLocation4); } return kSceneInvalid; @@ -1514,20 +1510,20 @@ void Action::pickCorpse(ObjectLocation bedPosition, bool process) const { // Floor case kObjectLocation1: - if (bedPosition != 4) { - playAnimation(getProgress().jacket == kJacketGreen ? kEventCorpsePickFloorGreen : kEventCorpsePickFloorOriginal); + // Bed is fully opened, move corpse directly there + if (bedPosition == 4) { + playAnimation(kEventCorpsePickFloorOpenedBedOriginal); + + getInventory()->get(kItemCorpse)->location = kObjectLocation5; break; } - if (getProgress().jacket) - playAnimation(kEventCorpsePickFloorOpenedBedOriginal); - - getInventory()->get(kItemCorpse)->location = kObjectLocation5; + playAnimation(getProgress().jacket == kJacketGreen ? kEventCorpsePickFloorGreen : kEventCorpsePickFloorOriginal); break; // Bed case kObjectLocation2: - playAnimation(getProgress().jacket == kJacketGreen ? kEventCorpsePickFloorGreen : kEventCorpsePickBedOriginal); + playAnimation(getProgress().jacket == kJacketGreen ? kEventCorpsePickBedGreen : kEventCorpsePickBedOriginal); break; } @@ -1535,7 +1531,7 @@ void Action::pickCorpse(ObjectLocation bedPosition, bool process) const { getScenes()->processScene(); // Add corpse to inventory - if (bedPosition != 4) { // bed position + if (bedPosition != 4) { // bed is not fully opened getInventory()->addItem(kItemCorpse); getInventory()->selectItem(kItemCorpse); _engine->getCursor()->setStyle(kCursorCorpse); @@ -1765,7 +1761,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const { return kCursorNormal; if ((!getInventory()->getSelectedItem() || getInventory()->getSelectedEntry()->manualSelect) - && (object != kObject21 || getProgress().eventCorpseMovedFromFloor == 1)) + && (object != kObject21 || getProgress().eventCorpseMovedFromFloor == true)) return kCursorHand; else return kCursorNormal; |