XEEN: Fix Barok giving Enchant Item spell to party

This commit is contained in:
Paul Gilbert 2018-04-05 22:14:33 -04:00
parent c9460d1340
commit b8d3bffc3a

View File

@ -1154,14 +1154,16 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
ps._currentHp = 0;
break;
case 19: {
// Give spell to character
SpellsCategory category = ps.getSpellsCategory();
assert(category != SPELLCAT_INVALID);
for (int idx = 0; idx < SPELLS_PER_CLASS; ++idx) {
if (Res.SPELLS_ALLOWED[category][idx] == (int)giveVal) {
ps._spells[idx] = true;
intf.spellFX(&ps);
break;
if (category != SPELLCAT_INVALID) {
for (int idx = 0; idx < SPELLS_PER_CLASS; ++idx) {
if (Res.SPELLS_ALLOWED[category][idx] == (int)giveVal) {
ps._spells[idx] = true;
intf.spellFX(&ps);
break;
}
}
}
break;