From 16ced34bc2a21c99f775103008da0f1caf99e26d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 Mar 2015 20:54:35 -0500 Subject: MADS: Fix assert when there are more than 5 talk options available --- engines/mads/user_interface.cpp | 9 +++++---- 1 file changed, 5 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 929390a073..a53ab31968 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -843,10 +843,11 @@ void UserInterface::emptyConversationList() { } void UserInterface::addConversationMessage(int vocabId, const Common::String &msg) { - assert(_talkStrings.size() < 5); - - _talkStrings.push_back(msg); - _talkIds.push_back(vocabId); + // Only allow a maximum of 5 talk entries to be displayed + if (_talkStrings.size() < 5) { + _talkStrings.push_back(msg); + _talkIds.push_back(vocabId); + } } void UserInterface::loadInventoryAnim(int objectId) { -- cgit v1.2.3