From 54ff19bcf501516555ee37059bf6ac0e6f01baa3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Apr 2018 18:40:47 -0400 Subject: XEEN: Fix double-casting of spells during combat --- engines/xeen/interface.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 1a7900274c..3da5dc7894 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -512,21 +512,18 @@ void Interface::perform() { } break; - case Common::KEYCODE_c: { + case Common::KEYCODE_c: // Cast spell if (_tillMove) { combat.moveMonsters(); draw3d(true); } - int result = CastSpell::show(_vm); - - if (result == 1) { + if (CastSpell::show(_vm) != -1) { chargeStep(); doStepCode(); } break; - } case Common::KEYCODE_i: // Show Info dialog @@ -1442,7 +1439,6 @@ void Interface::doCombat() { Map &map = *_vm->_map; Party &party = *_vm->_party; Scripts &scripts = *_vm->_scripts; - Spells &spells = *_vm->_spells; Sound &sound = *_vm->_sound; Windows &windows = *_vm->_windows; bool upDoorText = _upDoorText; @@ -1556,10 +1552,7 @@ void Interface::doCombat() { case Common::KEYCODE_c: { // Cast spell - int spellId = CastSpell::show(_vm); - if (spellId != -1) { - Character *c = combat._combatParty[combat._whosTurn]; - spells.castSpell(c, (MagicSpell)spellId); + if (CastSpell::show(_vm) != -1) { nextChar(); } else { highlightChar(combat._whosTurn); -- cgit v1.2.3