[Scummvm-git-logs] scummvm master -> 7ed7e022f1ef4cabb35cd38f8c04a1bb9bd6461f

dreammaster dreammaster at scummvm.org
Thu Jul 6 00:23:36 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:
7ed7e022f1 TITANIC: Fix parrot to only eat hot plain chickens


Commit: 7ed7e022f1ef4cabb35cd38f8c04a1bb9bd6461f
    https://github.com/scummvm/scummvm/commit/7ed7e022f1ef4cabb35cd38f8c04a1bb9bd6461f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-07-05T18:23:23-04:00

Commit Message:
TITANIC: Fix parrot to only eat hot plain chickens

Changed paths:
    engines/titanic/carry/chicken.cpp
    engines/titanic/messages/messages.h
    engines/titanic/npcs/parrot.cpp
    engines/titanic/npcs/parrot.h


diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 851b7b8..91d4c95 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -188,14 +188,14 @@ bool CChicken::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
 
 bool CChicken::ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg) {
 	if (_temperature > 0)
-		msg->_value1 = 1;
+		msg->_isHot = true;
 
 	if (_condiment == "Tomato") {
-		msg->_value2 = 1;
+		msg->_condiment = 1;
 	} else if (_condiment == "Mustard") {
-		msg->_value2 = 2;
+		msg->_condiment = 2;
 	} else if (_condiment == "Bird") {
-		msg->_value2 = 3;
+		msg->_condiment = 3;
 	}
 
 	return true;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 0b1da59..dfedfdb 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -301,7 +301,7 @@ MESSAGE1(COnSummonBotMsg, int, value, 0);
 MESSAGE0(COpeningCreditsMsg);
 MESSAGE1(CPanningAwayFromParrotMsg, CMovePlayerTo *, target, nullptr);
 MESSAGE2(CParrotSpeakMsg, CString, target, "", CString, action, "");
-MESSAGE2(CParrotTriesChickenMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CParrotTriesChickenMsg, bool, isHot, false, int, condiment, 0);
 MESSAGE1(CPhonographPlayMsg, int, value, 0);
 MESSAGE0(CPhonographReadyToPlayMsg);
 MESSAGE1(CPhonographRecordMsg, bool, canRecord, false);
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index b46a9bc..c8f833b 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -60,7 +60,7 @@ CParrot::CParrot() : CTrueTalkNPC() {
 	_lastSpeakTime = 0;
 	_newXp = 73;
 	_newXc = 58;
-	_canEatChicken = false;
+	_triedEatChicken = false;
 	_eatOffsetX = 0;
 	_panTarget = nullptr;
 
@@ -84,7 +84,7 @@ void CParrot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_lastSpeakTime, indent);
 	file->writeNumberLine(_newXp, indent);
 	file->writeNumberLine(_newXc, indent);
-	file->writeNumberLine(_canEatChicken, indent);
+	file->writeNumberLine(_triedEatChicken, indent);
 	file->writeNumberLine(_eatOffsetX, indent);
 	file->writeNumberLine(_state, indent);
 	file->writeNumberLine(_coreReplaced, indent);
@@ -108,7 +108,7 @@ void CParrot::load(SimpleFile *file) {
 	_lastSpeakTime = file->readNumber();
 	_newXp = file->readNumber();
 	_newXc = file->readNumber();
-	_canEatChicken = file->readNumber();
+	_triedEatChicken = file->readNumber();
 	_eatOffsetX = file->readNumber();
 	_state = (ParrotState)file->readNumber();
 	_coreReplaced = file->readNumber();
@@ -133,7 +133,7 @@ bool CParrot::ActMsg(CActMsg *msg) {
 		if (_state == PARROT_IN_CAGE) {
 			stopMovie();
 			startTalking(this, 280275, findView());
-			_canEatChicken = false;
+			_triedEatChicken = false;
 		}
 	} else if (msg->_action == "EnteringFromTOW" &&
 			(_state == PARROT_IN_CAGE || _state == PARROT_ESCAPED)) {
@@ -325,7 +325,7 @@ bool CParrot::EnterViewMsg(CEnterViewMsg *msg) {
 		}
 
 		petSetArea(PET_CONVERSATION);
-		_canEatChicken = false;
+		_triedEatChicken = false;
 		_npcFlags |= NPCFLAG_START_IDLING;
 	}
 
@@ -590,28 +590,28 @@ bool CParrot::FrameMsg(CFrameMsg *msg) {
 			_npcFlags |= NPCFLAG_MOVE_LEFT;
 			playClip("Walk Left Intro", MOVIE_NOTIFY_OBJECT);
 		}
-	} else if (chickenFlag && pt.y >= 90 && pt.y <= 280 && !_canEatChicken) {
+	} else if (chickenFlag && pt.y >= 90 && pt.y <= 280 && !_triedEatChicken) {
 		CParrotTriesChickenMsg triesMsg;
 		triesMsg.execute(dragObject);
 
 		CTrueTalkTriggerActionMsg triggerMsg;
 		int &action = triggerMsg._action;
-		switch (triesMsg._value2) {
+		switch (triesMsg._condiment) {
 		case 1:
-			action = 280056 + (triesMsg._value1 ? 234 : 0);
+			action = 280056 + (triesMsg._isHot ? 234 : 0);
 			break;
 		case 2:
-			action = 280055 + (triesMsg._value1 ? 234 : 0);
+			action = 280055 + (triesMsg._isHot ? 234 : 0);
 			break;
 		case 3:
-			action = 280054 + (triesMsg._value1 ? 234 : 0);
+			action = 280054 + (triesMsg._isHot ? 234 : 0);
 			break;
 		default:
-			action = 280053 + (triesMsg._value1 ? 234 : 0);
+			action = 280053 + (triesMsg._isHot ? 213 : 0);
 			break;
 		}
 
-		if (action != 280266) {
+		if (action == 280266) {
 			if (pt.x < 75) {
 				// Parrot needs to reach outside the cage
 				_npcFlags |= NPCFLAG_CHICKEN_OUTSIDE_CAGE;
@@ -637,7 +637,7 @@ bool CParrot::FrameMsg(CFrameMsg *msg) {
 		if (chickenFlag) {
 			triggerMsg._param2 = 1;
 			triggerMsg.execute(this);
-			_canEatChicken = true;
+			_triedEatChicken = true;
 		}
 	}
 
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
index d3558df..c3ba5a5 100644
--- a/engines/titanic/npcs/parrot.h
+++ b/engines/titanic/npcs/parrot.h
@@ -66,7 +66,7 @@ private:
 	uint _lastSpeakTime;
 	int _newXp;
 	int _newXc;
-	bool _canEatChicken;
+	bool _triedEatChicken;
 	int _eatOffsetX;
 	CMovePlayerTo *_panTarget;
 public:





More information about the Scummvm-git-logs mailing list