[Scummvm-git-logs] scummvm master -> ffb6d79dcdb3ecfb4912515763ab0aa862e4ace3
bluegr
noreply at scummvm.org
Sun Nov 6 19:49:13 UTC 2022
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:
ffb6d79dcd MADS: Fix infinite conversation loop at the beginning of Phantom
Commit: ffb6d79dcdb3ecfb4912515763ab0aa862e4ace3
https://github.com/scummvm/scummvm/commit/ffb6d79dcdb3ecfb4912515763ab0aa862e4ace3
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-11-06T21:48:47+02:00
Commit Message:
MADS: Fix infinite conversation loop at the beginning of Phantom
Also, update the conversation modes enum
Changed paths:
engines/mads/conversations.cpp
engines/mads/conversations.h
engines/mads/scene.cpp
diff --git a/engines/mads/conversations.cpp b/engines/mads/conversations.cpp
index 674c19622c6..a5689b0296a 100644
--- a/engines/mads/conversations.cpp
+++ b/engines/mads/conversations.cpp
@@ -105,7 +105,7 @@ void GameConversations::run(int id) {
_heroTrigger = 0;
_interlocutorTrigger = 0;
_popupVisible = false;
- _currentMode = CONVMODE_0;
+ _currentMode = CONVMODE_NEXT;
_verbId = -1;
_speakerVal = 1;
_personSpeaking = 1;
@@ -297,7 +297,7 @@ void GameConversations::update(bool flag) {
ConversationVar &var0 = _runningConv->_cnd._vars[0];
switch (_currentMode) {
- case CONVMODE_0:
+ case CONVMODE_NEXT:
assert(var0.isNumeric());
if (var0._val < 0) {
if (_vm->_game->_scene._frameStartTime >= _startFrameNumber) {
@@ -320,19 +320,19 @@ void GameConversations::update(bool flag) {
_vm->_game->_scene._action._activeAction._verbId = _verbId;
_vm->_game->_scene._action._inProgress = true;
_vm->_game->_scene._action._savedFields._commandError = false;
- _currentMode = CONVMODE_1;
+ _currentMode = CONVMODE_WAIT_AUTO;
} else {
_currentMode = generateMenu();
}
}
break;
- case CONVMODE_1:
+ case CONVMODE_WAIT_AUTO:
if (flag)
- _currentMode = CONVMODE_3;
+ _currentMode = CONVMODE_EXECUTE;
break;
- case CONVMODE_2:
+ case CONVMODE_WAIT_ENTRY:
if (flag) {
_vm->_game->_player._stepEnabled = false;
_verbId = _vm->_game->_scene._action._activeAction._verbId;
@@ -353,7 +353,7 @@ void GameConversations::update(bool flag) {
}
generateText(dialog._textLineIndex, _runningConv->_cnd._messageList3);
- _currentMode = CONVMODE_0;
+ _currentMode = CONVMODE_NEXT;
if (_heroTrigger) {
_vm->_game->_scene._action._activeAction._verbId = _verbId;
@@ -364,7 +364,7 @@ void GameConversations::update(bool flag) {
}
break;
- case CONVMODE_3:
+ case CONVMODE_EXECUTE:
if (_vm->_game->_scene._frameStartTime >= _startFrameNumber) {
removeActiveWindow();
_personSpeaking = 0;
@@ -378,17 +378,19 @@ void GameConversations::update(bool flag) {
_heroTrigger = 0;
}
- _currentMode = CONVMODE_4;
+ _currentMode = CONVMODE_REPLY;
}
break;
- case CONVMODE_4:
+ case CONVMODE_REPLY:
if (_vm->_game->_scene._frameStartTime >= _startFrameNumber) {
removeActiveWindow();
_personSpeaking = _speakerVal;
generateMessage(_runningConv->_cnd._messageList2, _runningConv->_cnd._messageList4);
+ _currentMode = CONVMODE_NEXT;
+
if (_interlocutorTrigger && _popupVisible) {
_vm->_game->_scene._action._activeAction._verbId = _verbId;
_vm->_game->_trigger = _interlocutorTrigger;
diff --git a/engines/mads/conversations.h b/engines/mads/conversations.h
index 4e775e7a900..f347306a039 100644
--- a/engines/mads/conversations.h
+++ b/engines/mads/conversations.h
@@ -35,11 +35,11 @@ namespace MADS {
enum ConversationMode {
CONVMODE_NONE = -1,
- CONVMODE_0 = 0,
- CONVMODE_1 = 1,
- CONVMODE_2 = 2,
- CONVMODE_3 = 3,
- CONVMODE_4 = 4,
+ CONVMODE_NEXT = 0,
+ CONVMODE_WAIT_AUTO = 1,
+ CONVMODE_WAIT_ENTRY = 2,
+ CONVMODE_EXECUTE = 3,
+ CONVMODE_REPLY = 4,
CONVMODE_5 = 5,
CONVMODE_6 = 6,
CONVMODE_7 = 7,
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 9ebb719ceaf..491a7916d31 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -561,7 +561,7 @@ void Scene::doAction() {
// Don't allow the player to move if a conversation is active
if (_vm->_gameConv->active()) {
_vm->_game->_scene._action._savedFields._lookFlag = false;
- if (_vm->_gameConv->currentMode() == CONVMODE_2 || _vm->_gameConv->currentMode() == CONVMODE_3)
+ if (_vm->_gameConv->currentMode() == CONVMODE_WAIT_ENTRY || _vm->_gameConv->currentMode() == CONVMODE_EXECUTE)
_vm->_game->_player._stepEnabled = false;
}
@@ -605,8 +605,8 @@ void Scene::doAction() {
if (_vm->_game->_triggerMode == SEQUENCE_TRIGGER_PARSER)
_vm->_game->_trigger = 0;
- if (_vm->_gameConv->active() && (_vm->_gameConv->currentMode() == CONVMODE_1 ||
- _vm->_gameConv->currentMode() == CONVMODE_2))
+ if (_vm->_gameConv->active() && (_vm->_gameConv->currentMode() == CONVMODE_WAIT_AUTO ||
+ _vm->_gameConv->currentMode() == CONVMODE_WAIT_ENTRY))
_vm->_gameConv->update(true);
}
More information about the Scummvm-git-logs
mailing list