aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/toltecs/screen.cpp9
-rw-r--r--engines/toltecs/screen.h1
-rw-r--r--engines/toltecs/toltecs.cpp5
3 files changed, 15 insertions, 0 deletions
diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp
index 2f16c29ab2..be91130c0a 100644
--- a/engines/toltecs/screen.cpp
+++ b/engines/toltecs/screen.cpp
@@ -481,6 +481,15 @@ void Screen::addTalkTextItemsToRenderQueue() {
}
}
+bool Screen::isTalkTextActive(int16 slotIndex) {
+ for (int16 i = 0; i <= _talkTextItemNum; i++) {
+ if (_talkTextItems[i].slotIndex == slotIndex && _talkTextItems[i].duration > 0)
+ return true;
+ }
+
+ return false;
+}
+
int16 Screen::getTalkTextDuration() {
return _talkTextItems[_talkTextItemNum].duration;
}
diff --git a/engines/toltecs/screen.h b/engines/toltecs/screen.h
index f4ecd2ca62..ee565e1882 100644
--- a/engines/toltecs/screen.h
+++ b/engines/toltecs/screen.h
@@ -182,6 +182,7 @@ public:
void addTalkTextRect(Font &font, int16 x, int16 &y, int16 length, int16 width, TalkTextItem *item);
void addTalkTextItemsToRenderQueue();
int16 getTalkTextDuration();
+ bool isTalkTextActive(int16 slotIndex);
void finishTalkTextItems();
void keepTalkTextItemsAlive();
diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp
index 02a0e338a0..1a399dacc0 100644
--- a/engines/toltecs/toltecs.cpp
+++ b/engines/toltecs/toltecs.cpp
@@ -495,6 +495,11 @@ void ToltecsEngine::updateCamera() {
void ToltecsEngine::talk(int16 slotIndex, int16 slotOffset) {
byte *scanData = _script->getSlotData(slotIndex) + slotOffset;
+ // If there's another talk text at the requested slot and it's still
+ // active, don't overwrite it. Fixes bug #3600166.
+ if (_screen->isTalkTextActive(slotIndex))
+ return;
+
while (*scanData < 0xF0) {
if (*scanData == 0x19) {
scanData++;