[Scummvm-git-logs] scummvm master -> 05f668ab34afa2a5dcb24b02f22c3aecd9692b8c

dreammaster dreammaster at scummvm.org
Sun Aug 20 22:05:50 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
05f668ab34 TITANIC: Properly reset Parrot flag if you look away while he's eating


Commit: 05f668ab34afa2a5dcb24b02f22c3aecd9692b8c
    https://github.com/scummvm/scummvm/commit/05f668ab34afa2a5dcb24b02f22c3aecd9692b8c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-20T16:05:41-04:00

Commit Message:
TITANIC: Properly reset Parrot flag if you look away while he's eating

Changed paths:
    engines/titanic/npcs/parrot.cpp
    engines/titanic/npcs/parrot.h


diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index a0f80ca..d1ca478 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
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
index c3ba5a5..6fc4d6a 100644
--- a/engines/titanic/npcs/parrot.h
+++ b/engines/titanic/npcs/parrot.h
@@ -69,6 +69,11 @@ private:
 	bool _triedEatChicken;
 	int _eatOffsetX;
 	CMovePlayerTo *_panTarget;
+private:
+	/**
+	 * Called for the Parrot to start or finish eating
+	 */
+	void setEatingChicken(bool eating);
 public:
 	CLASSDEF;
 	CParrot();





More information about the Scummvm-git-logs mailing list