aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/user_interface.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-04-24 09:21:21 -0400
committerPaul Gilbert2014-04-24 09:21:21 -0400
commitf18104e7564b9d0b7a0377bd9510959d7a2d8867 (patch)
tree6b163db99cf8640ae431e089ffcae51e51fa2c5c /engines/mads/user_interface.cpp
parent1098246f2be705de82dd3077dd25323380c32dd1 (diff)
downloadscummvm-rg350-f18104e7564b9d0b7a0377bd9510959d7a2d8867.tar.gz
scummvm-rg350-f18104e7564b9d0b7a0377bd9510959d7a2d8867.tar.bz2
scummvm-rg350-f18104e7564b9d0b7a0377bd9510959d7a2d8867.zip
MADS: Fixed Conversation::read method
Diffstat (limited to 'engines/mads/user_interface.cpp')
-rw-r--r--engines/mads/user_interface.cpp12
1 files changed, 8 insertions, 4 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) {