[Scummvm-git-logs] scummvm master -> 04952b6645f3f5d454c54c493a61eaccb76afa80

dreammaster dreammaster at scummvm.org
Wed Dec 21 13:38:59 CET 2016


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:
04952b6645 TITANIC: Remove parrot from inventory when it escapes


Commit: 04952b6645f3f5d454c54c493a61eaccb76afa80
    https://github.com/scummvm/scummvm/commit/04952b6645f3f5d454c54c493a61eaccb76afa80
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-12-21T07:38:54-05:00

Commit Message:
TITANIC: Remove parrot from inventory when it escapes

Changed paths:
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/carry/carry_parrot.h


diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index cbc8028..70b191b 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -42,13 +42,13 @@ BEGIN_MESSAGE_MAP(CCarryParrot, CCarry)
 	ON_MESSAGE(ActMsg)
 END_MESSAGE_MAP()
 
-CCarryParrot::CCarryParrot() : CCarry(), _string6("PerchedParrot"),
+CCarryParrot::CCarryParrot() : CCarry(), _parrotName("PerchedParrot"),
 		_timerId(0), _freeCounter(0), _feathersFlag(false) {
 }
 
 void CCarryParrot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string6, indent);
+	file->writeQuotedLine(_parrotName, indent);
 	file->writeNumberLine(_timerId, indent);
 	file->writeNumberLine(_freeCounter, indent);
 	file->writeNumberLine(_feathersFlag, indent);
@@ -58,7 +58,7 @@ void CCarryParrot::save(SimpleFile *file, int indent) {
 
 void CCarryParrot::load(SimpleFile *file) {
 	file->readNumber();
-	_string6 = file->readString();
+	_parrotName = file->readString();
 	_timerId = file->readNumber();
 	_freeCounter = file->readNumber();
 	_feathersFlag = file->readNumber();
@@ -164,7 +164,7 @@ bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 		return CCarry::PassOnDragStartMsg(msg);
 	}
 
-	CTrueTalkNPC *npc = dynamic_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6));
+	CTrueTalkNPC *npc = dynamic_cast<CTrueTalkNPC *>(getRoot()->findByName(_parrotName));
 	if (npc)
 		startTalking(npc, 0x446BF);
 
@@ -195,7 +195,7 @@ bool CCarryParrot::UseWithCharMsg(CUseWithCharMsg *msg) {
 
 bool CCarryParrot::ActMsg(CActMsg *msg) {
 	if (msg->_action == "FreeParrot" && (CParrot::_v4 == 4 || CParrot::_v4 == 1)) {
-		CTrueTalkNPC *npc = dynamic_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6));
+		CTrueTalkNPC *npc = dynamic_cast<CTrueTalkNPC *>(getRoot()->findByName(_parrotName));
 		if (npc)
 			startTalking(npc, 0x446BF);
 
@@ -203,9 +203,6 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
 		_fieldE0 = 0;
 
 		if (CParrot::_v4 == 4) {
-			CActMsg actMsg("Shut");
-			actMsg.execute("ParrotCage");
-		} else {
 			playSound("z#475.wav");
 
 			if (!_feathersFlag) {
@@ -218,13 +215,17 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
 				_feathersFlag = true;
 			}
 
-			getPetControl()->removeFromInventory(this);
-			getPetControl()->setAreaChangeType(1);
+			CPetControl *pet = getPetControl();
+			pet->removeFromInventory(this);
+			pet->setAreaChangeType(1);
 			moveUnder(getRoom());
+		} else {
+			CActMsg actMsg("Shut");
+			actMsg.execute("ParrotCage");
 		}
 
 		CParrot::_v4 = 2;
-		stopTimer(_timerId);
+		stopAnimTimer(_timerId);
 		_timerId = 0;
 	}
 
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index c42475e..e165482 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -42,7 +42,7 @@ class CCarryParrot : public CCarry {
 	bool UseWithCharMsg(CUseWithCharMsg *msg);
 	bool ActMsg(CActMsg *msg);
 private:
-	CString _string6;
+	CString _parrotName;
 	int _timerId;
 	int _freeCounter;
 	bool _feathersFlag;





More information about the Scummvm-git-logs mailing list