From 63b3b82657fb5a3c4d3782eaf3848ffd32c4258a Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 25 May 2012 16:23:49 +0200 Subject: [PATCH] don't allow more than 4 potion effects --- apps/openmw/mwgui/alchemywindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/alchemywindow.cpp b/apps/openmw/mwgui/alchemywindow.cpp index c9548e05d..bd2f05289 100644 --- a/apps/openmw/mwgui/alchemywindow.cpp +++ b/apps/openmw/mwgui/alchemywindow.cpp @@ -281,9 +281,10 @@ namespace MWGui ++it; } - // now remove duplicates + // now remove duplicates, and don't allow more than 4 effects Widgets::SpellEffectList old = effects; effects.clear(); + int i=0; for (Widgets::SpellEffectList::iterator it = old.begin(); it != old.end(); ++it) { @@ -294,8 +295,11 @@ namespace MWGui if (*it2 == *it) found = true; } - if (!found) + if (!found && i<4) + { + ++i; effects.push_back(*it); + } } mEffects = effects;