From f18104e7564b9d0b7a0377bd9510959d7a2d8867 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 24 Apr 2014 09:21:21 -0400 Subject: MADS: Fixed Conversation::read method --- engines/mads/user_interface.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'engines/mads/user_interface.cpp') 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) { -- cgit v1.2.3