diff options
author | Paul Gilbert | 2018-04-05 22:14:33 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-04-05 22:14:33 -0400 |
commit | b8d3bffc3ae385b3eb6655326d5bb889b6122408 (patch) | |
tree | 5e36a142adc739d0f5630f6ac1a0c2563ae51885 /engines | |
parent | c9460d1340ab29cd453a8e4547ee6abccc51093c (diff) | |
download | scummvm-rg350-b8d3bffc3ae385b3eb6655326d5bb889b6122408.tar.gz scummvm-rg350-b8d3bffc3ae385b3eb6655326d5bb889b6122408.tar.bz2 scummvm-rg350-b8d3bffc3ae385b3eb6655326d5bb889b6122408.zip |
XEEN: Fix Barok giving Enchant Item spell to party
Diffstat (limited to 'engines')
-rw-r--r-- | engines/xeen/party.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index d53c1f2450..50c5992129 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -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; |