aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mads/user_interface.cpp12
-rw-r--r--engines/mads/user_interface.h5
2 files changed, 11 insertions, 6 deletions
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index 9a63ac32ad..d4ab0d3dc5 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -258,16 +258,20 @@ void Conversation::set(int quoteId, ...) {
va_end(va);
}
-bool Conversation::read(int quoteId) {
+int Conversation::read(int quoteId) {
uint16 flags = _vm->_game->globals()[_globalId];
+ int count = 0;
for (uint idx = 0; idx < _quotes.size(); ++idx) {
- if (_quotes[idx] == quoteId) {
+ if (flags & (1 << idx))
+ ++count;
+
+ if (_quotes[idx] == quoteId)
return flags & (1 << idx);
- }
}
- return false;
+ // Could not find it, simply return number of active quotes
+ return count;
}
void Conversation::write(int quoteId, bool flag) {
diff --git a/engines/mads/user_interface.h b/engines/mads/user_interface.h
index 1e07681a6f..9948278a55 100644
--- a/engines/mads/user_interface.h
+++ b/engines/mads/user_interface.h
@@ -114,9 +114,10 @@ public:
void set(int quoteId, ...);
/**
- * Returns true whether the given quote is enabled in the conversation
+ * Returns the bit for a given quote to indicate whether it's active or not or,
+ * if 0 is passed, returns the number of currently active quotes
*/
- bool read(int quoteId);
+ int read(int quoteId);
/**
* Activates or deactivates the specified quote in the given conversation node