aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-02-18 21:42:57 -0500
committerPaul Gilbert2015-02-18 21:42:57 -0500
commitaa89e602a2d261a24861bf65877bba3fab647409 (patch)
tree51fc1dd01f3b642bdda717a2fc967c1decc93b73 /engines
parentda368f5e008795168daa98dace83d6510100d8bc (diff)
downloadscummvm-rg350-aa89e602a2d261a24861bf65877bba3fab647409.tar.gz
scummvm-rg350-aa89e602a2d261a24861bf65877bba3fab647409.tar.bz2
scummvm-rg350-aa89e602a2d261a24861bf65877bba3fab647409.zip
XEEN: Spell dialogs fixes for non-casters
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/dialogs_spells.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/xeen/dialogs_spells.cpp b/engines/xeen/dialogs_spells.cpp
index 2f4026b2ad..dbe48c1a99 100644
--- a/engines/xeen/dialogs_spells.cpp
+++ b/engines/xeen/dialogs_spells.cpp
@@ -75,7 +75,7 @@ Character *SpellsDialog::execute(Character *c, int isCasting) {
_spells.clear();
const char *errorMsg = setSpellText(c, castingCopy);
screen._windows[25].writeString(Common::String::format(SPELLS_FOR,
- errorMsg == nullptr ? SPELL_LINES_0_TO_9 : nullptr,
+ errorMsg == nullptr ? SPELL_LINES_0_TO_9 : "",
c->_name.c_str()));
// Setup and write out spell list
@@ -92,6 +92,9 @@ Character *SpellsDialog::execute(Character *c, int isCasting) {
}
}
+ if (_spells.size() == 0)
+ names[0] = errorMsg;
+
screen._windows[37].writeString(Common::String::format(SPELLS_DIALOG_SPELLS,
colors[0], names[0], colors[1], names[1], colors[2], names[2],
colors[3], names[3], colors[4], names[4], colors[5], names[5],
@@ -150,7 +153,7 @@ Character *SpellsDialog::execute(Character *c, int isCasting) {
int spellIndex = (c->_currentSpell == -1) ? 39 : c->_currentSpell;
int spellId = SPELLS_ALLOWED[category][spellIndex];
screen._windows[10].writeString(Common::String::format(SPELL_DETAILS,
- spells._spellNames[spellId].c_str(),
+ c->_name.c_str(), spells._spellNames[spellId].c_str(),
spells.calcSpellPoints(spellId, c->getCurrentLevel()),
SPELL_GEM_COST[spellId], c->_currentSp));
}
@@ -555,6 +558,9 @@ int CastSpell::execute(Character *&c, int mode) {
w.close();
intf.unhighlightChar();
+ if (_vm->shouldQuit())
+ spellId = -1;
+
return spellId;
}