diff options
author | Paul Gilbert | 2017-08-20 16:05:41 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-08-20 16:05:41 -0400 |
commit | 05f668ab34afa2a5dcb24b02f22c3aecd9692b8c (patch) | |
tree | d8152122c0fefda88d2acf0a4e0366b6a1c50991 /engines/titanic/npcs/parrot.cpp | |
parent | cd9fe5c219d647bc8d3bc4cab6be29c7f2bc4525 (diff) | |
download | scummvm-rg350-05f668ab34afa2a5dcb24b02f22c3aecd9692b8c.tar.gz scummvm-rg350-05f668ab34afa2a5dcb24b02f22c3aecd9692b8c.tar.bz2 scummvm-rg350-05f668ab34afa2a5dcb24b02f22c3aecd9692b8c.zip |
TITANIC: Properly reset Parrot flag if you look away while he's eating
Diffstat (limited to 'engines/titanic/npcs/parrot.cpp')
-rw-r--r-- | engines/titanic/npcs/parrot.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp index a0f80ca69b..d1ca4781b1 100644 --- a/engines/titanic/npcs/parrot.cpp +++ b/engines/titanic/npcs/parrot.cpp @@ -122,12 +122,8 @@ bool CParrot::ActMsg(CActMsg *msg) { if (msg->_action == "Chicken") { // Nothing to do } else if (msg->_action == "CarryParrotLeftView") { - if (!_takeOff) { - _eatingChicken = false; - CStatusChangeMsg statusMsg; - statusMsg._newStatus = 1; - statusMsg.execute("PerchCoreHolder"); - } + if (!_takeOff) + setEatingChicken(false); } else if (msg->_action == "StartChickenDrag") { if (_state == PARROT_IN_CAGE) { stopMovie(); @@ -258,11 +254,7 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) { playClip("Eat Chicken 2", MOVIE_NOTIFY_OBJECT); if (chicken) { - _eatingChicken = true; - - CStatusChangeMsg statusMsg; - statusMsg._newStatus = 0; - statusMsg.execute("PerchCoreHolder"); + setEatingChicken(true); CTrueTalkTriggerActionMsg actionMsg; actionMsg._action = 280266; @@ -280,11 +272,7 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) { if (clipExistsByEnd("Eat Chicken 2", msg->_endFrame)) { // Parrot has finished eating Chicken - _eatingChicken = false; - - CStatusChangeMsg statusMsg; - statusMsg._newStatus = 1; - statusMsg.execute("PerchCoreHolder"); + setEatingChicken(false); if (_takeOff) { // Perch has been taken, so take off @@ -587,6 +575,10 @@ bool CParrot::FrameMsg(CFrameMsg *msg) { _npcFlags |= NPCFLAG_MOVING | NPCFLAG_MOVE_START; if (_newXc >= xp) { + // WORKAROUND: Original did not properly reset the eating chicken + // flag when the player turns away from the cage + setEatingChicken(false); + setPosition(Point(_bounds.left + 30, _bounds.top)); _npcFlags |= NPCFLAG_MOVE_RIGHT; playClip("Walk Right Intro", MOVIE_NOTIFY_OBJECT); @@ -708,6 +700,7 @@ bool CParrot::PreEnterViewMsg(CPreEnterViewMsg *msg) { } bool CParrot::PanningAwayFromParrotMsg(CPanningAwayFromParrotMsg *msg) { + warning("PAN"); if (_state != PARROT_IN_CAGE) { CActMsg actMsg("PanAwayFromParrot"); actMsg.execute(msg->_target); @@ -744,5 +737,11 @@ bool CParrot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) { return CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(msg); } +void CParrot::setEatingChicken(bool eating) { + _eatingChicken = eating; + CStatusChangeMsg statusMsg; + statusMsg._newStatus = eating ? 0 : 1; + statusMsg.execute("PerchCoreHolder"); +} } // End of namespace Titanic |