[Scummvm-git-logs] scummvm master -> c1b094bba830a4d1939bd61d0a929cd8f934d8fc

dreammaster dreammaster at scummvm.org
Mon Mar 19 02:29:59 CET 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:
c1b094bba8 XEEN: Fix spells list selection for Vertigo guild


Commit: c1b094bba830a4d1939bd61d0a929cd8f934d8fc
    https://github.com/scummvm/scummvm/commit/c1b094bba830a4d1939bd61d0a929cd8f934d8fc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-18T21:29:51-04:00

Commit Message:
XEEN: Fix spells list selection for Vertigo guild

Changed paths:
    devtools/create_xeen/constants.cpp
    engines/xeen/dialogs/dialogs_spells.cpp
    engines/xeen/resources.cpp
    engines/xeen/resources.h
    engines/xeen/spells.h


diff --git a/devtools/create_xeen/constants.cpp b/devtools/create_xeen/constants.cpp
index b001a22..9075ed5 100644
--- a/devtools/create_xeen/constants.cpp
+++ b/devtools/create_xeen/constants.cpp
@@ -1037,7 +1037,7 @@ const int DARK_SPELL_RANGES[12][2] = {
 	{ 0, 20 }, { 16, 35 }, { 27, 37 }, { 29, 39 }
 };
 
-const int CLOUDS_SPELL_OFFSETS[5][20] = {
+const int CLOUDS_GUILD_SPELLS[5][20] = {
 	{
 		1, 10, 20, 26, 27, 38, 40, 42, 45, 50,
 		55, 59, 60, 61, 62, 68, 72, 75, 77, 77
@@ -2002,7 +2002,7 @@ void writeConstants(CCArchive &cc) {
 	file.syncString(GUILD_OPTIONS);
 	file.syncNumbers((const int *)MISC_SPELL_INDEX, 74);
 	file.syncNumbers((const int *)SPELL_COSTS, 77);
-	file.syncNumbers2D((const int *)CLOUDS_SPELL_OFFSETS, 5, 20);
+	file.syncNumbers2D((const int *)CLOUDS_GUILD_SPELLS, 5, 20);
 	file.syncNumbers2D((const int *)DARK_SPELL_OFFSETS, 3, 39);
 	file.syncNumbers2D((const int *)DARK_SPELL_RANGES, 12, 2);
 	file.syncNumbers((const int *)SPELL_GEM_COST, 77);
diff --git a/engines/xeen/dialogs/dialogs_spells.cpp b/engines/xeen/dialogs/dialogs_spells.cpp
index d2b4730..c17859c 100644
--- a/engines/xeen/dialogs/dialogs_spells.cpp
+++ b/engines/xeen/dialogs/dialogs_spells.cpp
@@ -284,7 +284,7 @@ const char *SpellsDialog::setSpellText(Character *c, int mode) {
 	if ((mode & 0x7f) == 0) {
 		if (category != SPELLCAT_INVALID) {
 			if (party._mazeId == 49 || party._mazeId == 37) {
-				for (uint spellId = 0; spellId < 76; ++spellId) {
+				for (uint spellId = 0; spellId < TOTAL_SPELLS; ++spellId) {
 					int idx = 0;
 					while (idx < CHAR_MAX_SPELLS && Res.SPELLS_ALLOWED[category][idx] != (int)spellId)
 						++idx;
@@ -319,7 +319,7 @@ const char *SpellsDialog::setSpellText(Character *c, int mode) {
 			} else {
 				for (int spellId = 0; spellId < 20; ++spellId) {
 					int idx = 0;
-					while (Res.CLOUDS_SPELL_OFFSETS[party._mazeId - 29][spellId] !=
+					while (Res.CLOUDS_GUILD_SPELLS[party._mazeId - 28][spellId] !=
 						(int)Res.SPELLS_ALLOWED[category][idx] && idx < SPELLS_PER_CLASS)
 						++idx;
 
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp
index dcedf19..45e0989 100644
--- a/engines/xeen/resources.cpp
+++ b/engines/xeen/resources.cpp
@@ -182,7 +182,7 @@ void Resources::loadData() {
 	file.syncString(GUILD_OPTIONS);
 	file.syncNumbers((int *)MISC_SPELL_INDEX, 74);
 	file.syncNumbers((int *)SPELL_COSTS, 77);
-	file.syncNumbers2D((int *)CLOUDS_SPELL_OFFSETS, 5, 20);
+	file.syncNumbers2D((int *)CLOUDS_GUILD_SPELLS, 5, 20);
 	file.syncNumbers2D((int *)DARK_SPELL_OFFSETS, 3, 39);
 	file.syncNumbers2D((int *)DARK_SPELL_RANGES, 12, 2);
 	file.syncNumbers((int *)SPELL_GEM_COST, 77);
diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h
index 2dc564d..08aa90e 100644
--- a/engines/xeen/resources.h
+++ b/engines/xeen/resources.h
@@ -236,7 +236,7 @@ public:
 	const char *GUILD_OPTIONS;
 	int MISC_SPELL_INDEX[74];
 	int SPELL_COSTS[77];
-	int CLOUDS_SPELL_OFFSETS[5][20];
+	int CLOUDS_GUILD_SPELLS[5][20];
 	int DARK_SPELL_OFFSETS[3][39];
 	int DARK_SPELL_RANGES[12][2];
 	int SPELL_LEVEL_OFFSETS[3][39];
diff --git a/engines/xeen/spells.h b/engines/xeen/spells.h
index a333ea2..24e9dd1 100644
--- a/engines/xeen/spells.h
+++ b/engines/xeen/spells.h
@@ -56,7 +56,7 @@ enum MagicSpell {
 	MS_SuppressDisease = 67, MS_SuppressPoison = 68, MS_Teleport = 69,
 	MS_TimeDistortion = 70, MS_TownPortal = 71, MS_ToxicCloud = 72,
 	MS_TurnUndead = 73, MS_WalkOnWater = 74, MS_WizardEye = 75,
-	NO_SPELL = 76
+	NO_SPELL = 76, TOTAL_SPELLS = 76
 };
 
 class Spells {





More information about the Scummvm-git-logs mailing list