1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Fixed = Scholar won't give unavaliable spells anymore.

This commit is contained in:
DjWarmonger 2009-10-23 19:58:21 +00:00
parent 04ea5deb01
commit f0e04ad850

@ -3767,7 +3767,10 @@ void CGScholar::initObj()
bonusID = ran() % SKILL_QUANTITY;
break;
case 2:
bonusID = ran() % SPELLS_QUANTITY;
std::vector<ui16> possibilities;
for (int i = 1; i < 6; ++i)
cb->getAllowedSpells (possibilities, i);
bonusID = possibilities[ran() % possibilities.size()];
break;
}
}