From 933927259e629c12f2ce06f250a89029381065f0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 5 Aug 2017 17:09:46 -0400 Subject: TITANIC: Fix releasing chicken in middle of parrot leaning out to eat --- engines/titanic/npcs/parrot.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'engines/titanic/npcs') diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp index e5c52f9615..60d11c0a6e 100644 --- a/engines/titanic/npcs/parrot.cpp +++ b/engines/titanic/npcs/parrot.cpp @@ -23,6 +23,8 @@ #include "titanic/npcs/parrot.h" #include "titanic/core/project_item.h" #include "titanic/carry/carry.h" +#include "titanic/carry/chicken.h" +#include "titanic/game_manager.h" namespace Titanic { @@ -249,22 +251,27 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) { return true; } else if (clipExistsByEnd("Lean Over To Chicken", msg->_endFrame)) { - // Leaning left out of cage to eat the chicken - playClip("Eat Chicken"); + // WORKAROUND: Do what the original obviously intended but got + // wrong.. only flag chicken as eaten if it's still being dragged + CTreeItem *dragItem = getGameManager()->_dragItem; + CCarry *chicken = dynamic_cast(dragItem); + + if (chicken) + playClip("Eat Chicken"); playClip("Eat Chicken 2", MOVIE_NOTIFY_OBJECT); - _eatingChicken = true; - CStatusChangeMsg statusMsg; - statusMsg._newStatus = 0; - statusMsg.execute("PerchCoreHolder"); + if (chicken) { + _eatingChicken = true; - CTrueTalkTriggerActionMsg actionMsg; - actionMsg._action = 280266; - actionMsg._param2 = 1; - actionMsg.execute(this); + CStatusChangeMsg statusMsg; + statusMsg._newStatus = 0; + statusMsg.execute("PerchCoreHolder"); + + CTrueTalkTriggerActionMsg actionMsg; + actionMsg._action = 280266; + actionMsg._param2 = 1; + actionMsg.execute(this); - CCarry *chicken = dynamic_cast(findUnder(getRoot(), "Chicken")); - if (chicken) { CActMsg actMsg("Eaten"); actMsg.execute(chicken); } -- cgit v1.2.3