mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fixed parsing for Mind Immunity.
This commit is contained in:
@@ -1019,18 +1019,22 @@ void CCreatureHandler::loadMindImmunity(Bonus & b, BonusList & bl, std::string &
|
|||||||
|
|
||||||
b.type = Bonus::SPELL_IMMUNITY;
|
b.type = Bonus::SPELL_IMMUNITY;
|
||||||
b.val = Bonus::BASE_NUMBER;
|
b.val = Bonus::BASE_NUMBER;
|
||||||
std::vector<si32> values;
|
si32 lastVal, curVal, lastLev = 0;
|
||||||
values.resize(10);
|
|
||||||
si32 val;
|
|
||||||
|
|
||||||
loadToIt (val, src, it, 4); //basic value
|
b.val = 0; //on-off ability, no value specified
|
||||||
for (int i = 0; i < 10; ++i)
|
loadToIt (curVal, src, it, 4); // 0 level is never active
|
||||||
|
for (int i = 1; i < 11; ++i)
|
||||||
{
|
{
|
||||||
loadToIt (values[i], src, it, 4);
|
loadToIt (curVal, src, it, 4);
|
||||||
if (values[i] = 2)
|
if (curVal == 1)
|
||||||
values[i] = 0;
|
{
|
||||||
|
b.val = curVal;
|
||||||
|
b.limiter.reset (new RankRangeLimiter(i));
|
||||||
|
break; //only one limiter here
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::vector<int> mindSpells = getMindSpells();
|
|
||||||
|
std::vector<int> mindSpells = getMindSpells(); //multiplicate spells
|
||||||
for (int g=0; g < mindSpells.size(); ++g)
|
for (int g=0; g < mindSpells.size(); ++g)
|
||||||
{
|
{
|
||||||
b.subtype = mindSpells[g];
|
b.subtype = mindSpells[g];
|
||||||
|
|||||||
Reference in New Issue
Block a user