forked from teamnwah/openmw-tes3coop
don't allow more than 4 potion effects
This commit is contained in:
parent
1df1b521a4
commit
63b3b82657
1 changed files with 6 additions and 2 deletions
|
@ -281,9 +281,10 @@ namespace MWGui
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
// now remove duplicates
|
// now remove duplicates, and don't allow more than 4 effects
|
||||||
Widgets::SpellEffectList old = effects;
|
Widgets::SpellEffectList old = effects;
|
||||||
effects.clear();
|
effects.clear();
|
||||||
|
int i=0;
|
||||||
for (Widgets::SpellEffectList::iterator it = old.begin();
|
for (Widgets::SpellEffectList::iterator it = old.begin();
|
||||||
it != old.end(); ++it)
|
it != old.end(); ++it)
|
||||||
{
|
{
|
||||||
|
@ -294,8 +295,11 @@ namespace MWGui
|
||||||
if (*it2 == *it)
|
if (*it2 == *it)
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found && i<4)
|
||||||
|
{
|
||||||
|
++i;
|
||||||
effects.push_back(*it);
|
effects.push_back(*it);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mEffects = effects;
|
mEffects = effects;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue