[Scummvm-git-logs] scummvm master -> 315b88e1bf6d93060ae7b35d22c6c31498f766f1

dreammaster dreammaster at scummvm.org
Sun Apr 8 19:55:27 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
315b88e1bf XEEN: Fix buying spells in Dark Side


Commit: 315b88e1bf6d93060ae7b35d22c6c31498f766f1
    https://github.com/scummvm/scummvm/commit/315b88e1bf6d93060ae7b35d22c6c31498f766f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-08T13:55:21-04:00

Commit Message:
XEEN: Fix buying spells in Dark Side

Changed paths:
    engines/xeen/dialogs/dialogs_spells.cpp


diff --git a/engines/xeen/dialogs/dialogs_spells.cpp b/engines/xeen/dialogs/dialogs_spells.cpp
index 0b6312c..e59fbde 100644
--- a/engines/xeen/dialogs/dialogs_spells.cpp
+++ b/engines/xeen/dialogs/dialogs_spells.cpp
@@ -305,9 +305,10 @@ const char *SpellsDialog::setSpellText(Character *c, int mode) {
 						spellId < Res.DARK_SPELL_RANGES[groupIndex][1]; ++spellId) {
 					int idx = 0;
 					while (idx <= SPELLS_PER_CLASS && Res.SPELLS_ALLOWED[category][idx] ==
-						Res.DARK_SPELL_OFFSETS[category][spellId]);
+							Res.DARK_SPELL_OFFSETS[category][spellId])
+						++idx;
 
-					if (idx <= SPELLS_PER_CLASS) {
+					if (idx < SPELLS_PER_CLASS) {
 						if (!c->_spells[idx] || (mode & 0x80)) {
 							int cost = spells.calcSpellCost(Res.SPELLS_ALLOWED[category][idx], expenseFactor);
 							_spells.push_back(SpellEntry(Common::String::format("\x3l%s\x3r\x9""000%u",
@@ -319,11 +320,11 @@ const char *SpellsDialog::setSpellText(Character *c, int mode) {
 			} else {
 				for (int spellId = 0; spellId < 20; ++spellId) {
 					int idx = 0;
-					while (Res.CLOUDS_GUILD_SPELLS[party._mazeId - 28][spellId] !=
-						(int)Res.SPELLS_ALLOWED[category][idx] && idx <= SPELLS_PER_CLASS)
+					while (idx < SPELLS_PER_CLASS && Res.CLOUDS_GUILD_SPELLS[party._mazeId - 28][spellId] !=
+							(int)Res.SPELLS_ALLOWED[category][idx])
 						++idx;
 
-					if (idx <= SPELLS_PER_CLASS) {
+					if (idx < SPELLS_PER_CLASS) {
 						if (!c->_spells[idx] || (mode & 0x80)) {
 							int cost = spells.calcSpellCost(Res.SPELLS_ALLOWED[category][idx], expenseFactor);
 							_spells.push_back(SpellEntry(Common::String::format("\x3l%s\x3r\x9""000%u",





More information about the Scummvm-git-logs mailing list