mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 03:54:40 +00:00
don't allow more than 4 potion effects
This commit is contained in:
parent
1df1b521a4
commit
63b3b82657
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user