[Scummvm-git-logs] scummvm master -> 9ef97cd265172cabf69ec8dbfcbdc3c5a370a50e
dreammaster
dreammaster at scummvm.org
Sat Mar 17 19:07:00 CET 2018
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:
9ef97cd265 TITANIC: Fix DoorbotScript _stateIndex cycling check
Commit: 9ef97cd265172cabf69ec8dbfcbdc3c5a370a50e
https://github.com/scummvm/scummvm/commit/9ef97cd265172cabf69ec8dbfcbdc3c5a370a50e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-17T14:06:26-04:00
Commit Message:
TITANIC: Fix DoorbotScript _stateIndex cycling check
Thanks to eriktorbjorn for pointing out the Coverity warning
Changed paths:
engines/titanic/true_talk/doorbot_script.cpp
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index d7389d1..0b33704 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -71,6 +71,8 @@ static const RoomDialogueId ROOM_DIALOGUES2_DE[] = {
DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+ _stateIndex = _doorbotState = 0;
+
loadRanges("Ranges/Doorbot");
loadResponses("Responses/Doorbot");
setupSentences();
@@ -108,7 +110,7 @@ void DoorbotScript::setupSentences() {
int DoorbotScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
if (tag == MKTAG('D', 'N', 'A', '1') || tag == MKTAG('H', 'H', 'G', 'Q') ||
tag == MKTAG('A', 'N', 'S', 'W') || tag == MKTAG('S', 'U', 'M', 'S')) {
- if (_stateIndex > 9)
+ if (_stateIndex > 8)
_stateIndex = 0;
addResponse(TRANSLATE(STATE_ARRAY_EN[_stateIndex], STATE_ARRAY_DE[_stateIndex]));
applyResponse();
More information about the Scummvm-git-logs
mailing list