diff options
author | Paul Gilbert | 2018-03-30 20:30:39 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-03-30 20:30:39 -0400 |
commit | 60bb10e92bf90c75f6966c4793c4e123b29ab51d (patch) | |
tree | 1c41acaa156a136f94c97c161b2c5373e79e1794 | |
parent | eca76ea91ec0b932d90d20608db2f4c1b9aae1cf (diff) | |
download | scummvm-rg350-60bb10e92bf90c75f6966c4793c4e123b29ab51d.tar.gz scummvm-rg350-60bb10e92bf90c75f6966c4793c4e123b29ab51d.tar.bz2 scummvm-rg350-60bb10e92bf90c75f6966c4793c4e123b29ab51d.zip |
XEEN: Fix to correct remember last caster when reopening Cast Spell dialog
-rw-r--r-- | engines/xeen/dialogs/dialogs_spells.cpp | 16 | ||||
-rw-r--r-- | engines/xeen/dialogs/dialogs_spells.h | 1 | ||||
-rw-r--r-- | engines/xeen/interface.cpp | 2 |
3 files changed, 6 insertions, 13 deletions
diff --git a/engines/xeen/dialogs/dialogs_spells.cpp b/engines/xeen/dialogs/dialogs_spells.cpp index 828281e688..3645b2e9b1 100644 --- a/engines/xeen/dialogs/dialogs_spells.cpp +++ b/engines/xeen/dialogs/dialogs_spells.cpp @@ -383,8 +383,10 @@ CastSpell::~CastSpell() { int CastSpell::show(XeenEngine *vm) { Combat &combat = *vm->_combat; + Interface &intf = *vm->_interface; Party &party = *vm->_party; Spells &spells = *vm->_spells; + int result = 0, spellId = 0; int charNum; // Get which character is doing the casting @@ -401,20 +403,11 @@ int CastSpell::show(XeenEngine *vm) { } } - Character *c = &party._activeParty[charNum]; - return show(vm, c); -} - -int CastSpell::show(XeenEngine *vm, Character *&c) { - Interface &intf = *vm->_interface; - Spells &spells = *vm->_spells; - CastSpell *dlg = new CastSpell(vm); - int spellId; - int result = -1; - // Highlight the character + Character *c = &party._activeParty[charNum]; intf.highlightChar(c); + CastSpell *dlg = new CastSpell(vm); do { spellId = dlg->execute(c); @@ -481,6 +474,7 @@ int CastSpell::execute(Character *&c) { if (_buttonValue < (int)party._activeParty.size()) { c = &party._activeParty[_buttonValue]; intf.highlightChar(_buttonValue); + spells._lastCaster = _buttonValue; redrawFlag = true; break; } diff --git a/engines/xeen/dialogs/dialogs_spells.h b/engines/xeen/dialogs/dialogs_spells.h index 6a4fe7a0cd..c6e46c4dc5 100644 --- a/engines/xeen/dialogs/dialogs_spells.h +++ b/engines/xeen/dialogs/dialogs_spells.h @@ -93,7 +93,6 @@ private: void loadButtons(); public: static int show(XeenEngine *vm); - static int show(XeenEngine *vm, Character *&c); }; class SpellOnWho : public ButtonContainer { diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 648b01f2c9..03e6797924 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -527,7 +527,7 @@ void Interface::perform() { spells._lastCaster >= (int)party._activeParty.size()) ? (int)party._activeParty.size() - 1 : spells._lastCaster]; - int result = CastSpell::show(_vm, c); + int result = CastSpell::show(_vm); if (result == 1) { chargeStep(); |