aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/dialogs_spells.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-02-26 19:58:05 -0500
committerPaul Gilbert2015-02-26 19:58:05 -0500
commitc069a7f805b18428d095a0adf643753ceeaa59e3 (patch)
treec9bb741563e4cdb1dbfe9d9081cbccb9019a8d69 /engines/xeen/dialogs_spells.cpp
parent19007bac4088f4933410438c242814915b20e4ac (diff)
downloadscummvm-rg350-c069a7f805b18428d095a0adf643753ceeaa59e3.tar.gz
scummvm-rg350-c069a7f805b18428d095a0adf643753ceeaa59e3.tar.bz2
scummvm-rg350-c069a7f805b18428d095a0adf643753ceeaa59e3.zip
XEEN: Fix mode change across display of CastSpell dialog
Diffstat (limited to 'engines/xeen/dialogs_spells.cpp')
-rw-r--r--engines/xeen/dialogs_spells.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/xeen/dialogs_spells.cpp b/engines/xeen/dialogs_spells.cpp
index ea423aac72..9a19ac2042 100644
--- a/engines/xeen/dialogs_spells.cpp
+++ b/engines/xeen/dialogs_spells.cpp
@@ -435,7 +435,7 @@ const char *SpellsDialog::setSpellText(Character *c, int isCasting) {
/*------------------------------------------------------------------------*/
-int CastSpell::show(XeenEngine *vm, int mode) {
+int CastSpell::show(XeenEngine *vm) {
Combat &combat = *vm->_combat;
Interface &intf = *vm->_interface;
Party &party = *vm->_party;
@@ -443,7 +443,7 @@ int CastSpell::show(XeenEngine *vm, int mode) {
int charNum;
// Get which character is doing the casting
- if (mode == MODE_COMBAT) {
+ if (vm->_mode == MODE_COMBAT) {
charNum = combat._whosTurn;
} else if (spells._lastCaster >= 0 && spells._lastCaster < (int)party._activeParty.size()) {
charNum = spells._lastCaster;
@@ -460,21 +460,21 @@ int CastSpell::show(XeenEngine *vm, int mode) {
intf.highlightChar(charNum);
CastSpell *dlg = new CastSpell(vm);
- int spellId = dlg->execute(c, mode);
+ int spellId = dlg->execute(c);
delete dlg;
return spellId;
}
-int CastSpell::show(XeenEngine *vm, Character *&c, int mode) {
+int CastSpell::show(XeenEngine *vm, Character *&c) {
CastSpell *dlg = new CastSpell(vm);
- int spellId = dlg->execute(c, mode);
+ int spellId = dlg->execute(c);
delete dlg;
return spellId;
}
-int CastSpell::execute(Character *&c, int mode) {
+int CastSpell::execute(Character *&c) {
EventsManager &events = *_vm->_events;
Interface &intf = *_vm->_interface;
Party &party = *_vm->_party;
@@ -482,7 +482,8 @@ int CastSpell::execute(Character *&c, int mode) {
Spells &spells = *_vm->_spells;
Window &w = screen._windows[10];
- Mode oldMode = (Mode)mode;
+ Mode oldMode = _vm->_mode;
+ _vm->_mode = MODE_3;
w.open();
loadButtons();
@@ -503,7 +504,6 @@ int CastSpell::execute(Character *&c, int mode) {
drawButtons(&screen);
w.update();
- _vm->_mode = MODE_3;
redrawFlag = false;
}
@@ -565,6 +565,7 @@ int CastSpell::execute(Character *&c, int mode) {
if (_vm->shouldQuit())
spellId = -1;
+ _vm->_mode = oldMode;
return spellId;
}