From b8d3bffc3ae385b3eb6655326d5bb889b6122408 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 Apr 2018 22:14:33 -0400 Subject: XEEN: Fix Barok giving Enchant Item spell to party --- engines/xeen/party.cpp | 14 ++++++++------ 1 file 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; -- cgit v1.2.3