mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
Fixed #178 = Scholar won't give unavaliable spells anymore.
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user