[Scummvm-git-logs] scummvm master -> ee458e557eeb1c5efea03fc3e6180808b0fe5ecd
dreammaster
dreammaster at scummvm.org
Fri Aug 18 01:57:48 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:
ee458e557e TITANIC: Fix magazine being winnable multiple times
Commit: ee458e557eeb1c5efea03fc3e6180808b0fe5ecd
https://github.com/scummvm/scummvm/commit/ee458e557eeb1c5efea03fc3e6180808b0fe5ecd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-17T19:57:42-04:00
Commit Message:
TITANIC: Fix magazine being winnable multiple times
Changed paths:
engines/titanic/core/game_object.cpp
engines/titanic/core/game_object.h
engines/titanic/game/television.cpp
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 5abc9f0..11b8b58 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -912,7 +912,7 @@ bool CGameObject::compareViewNameTo(const CString &name) const {
return !getViewFullName().compareToIgnoreCase(name);
}
-int CGameObject::compareRoomNameTo(const CString &name) {
+bool CGameObject::compareRoomNameTo(const CString &name) {
CRoomItem *room = getGameManager()->getRoom();
return !room->getName().compareToIgnoreCase(name);
}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 619c56b..f79c9e1 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -329,7 +329,7 @@ protected:
/**
* Compare the name of the parent room to the item to a passed string
*/
- int compareRoomNameTo(const CString &name);
+ bool compareRoomNameTo(const CString &name);
/**
* Gets the first object under the system MailMan
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 1380b44..80404fa 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -236,23 +236,31 @@ bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
}
if (_channelNum == 3 && compareRoomNameTo("SGTState") && getPassengerClass() == THIRD_CLASS) {
- // You may be a winner
- CProximity prox1, prox2;
- prox1._soundType = prox2._soundType = Audio::Mixer::kSpeechSoundType;
- playSound("z#47.wav", prox1);
- _soundHandle = playSound("b#20.wav", prox2);
- CMagazine *magazine = dynamic_cast<CMagazine *>(getRoot()->findByName("Magazine"));
+ // WORKAROUND: The original allowed the magazine to be "won" multiple times. We
+ // now search for magazine within the room (which is it's initial, hidden location).
+ // That way, when it's 'Won', it's no longer present and can't be won again
+ CMagazine *magazine = dynamic_cast<CMagazine *>(findRoom()->findByName("Magazine"));
if (magazine) {
+ // You may be a winner
+ CProximity prox1, prox2;
+ prox1._soundType = prox2._soundType = Audio::Mixer::kSpeechSoundType;
+ playSound("z#47.wav", prox1);
+ _soundHandle = playSound("b#20.wav", prox2);
+
+ // Get the room flags for the SGT floor we're on
CPetControl *pet = getPetControl();
uint roomFlags = pet->getRoomFlags();
- debugC(kDebugScripts, "Assigned room - %d", roomFlags);
+ // Send the magazine to the SuccUBus
+ debugC(DEBUG_INTERMEDIATE, kDebugScripts, "Assigned room - %d", roomFlags);
magazine->addMail(roomFlags);
magazine->sendMail(roomFlags, roomFlags);
- }
- loadFrame(561);
+ loadFrame(561);
+ } else {
+ petDisplayMessage(NOTHING_ON_CHANNEL);
+ }
} else if (_channelNum == 2) {
loadFrame(_seasonFrame);
} else if (_channelNum == 4 && _channel4Glyph) {
More information about the Scummvm-git-logs
mailing list