[Scummvm-git-logs] scummvm master -> 48a1f3786991f94d98a7f2690eb99172518269df

dreammaster dreammaster at scummvm.org
Thu Nov 23 17:47:11 CET 2017


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:
48a1f37869 XEEN: Fixes for initializing blacksmith wares


Commit: 48a1f3786991f94d98a7f2690eb99172518269df
    https://github.com/scummvm/scummvm/commit/48a1f3786991f94d98a7f2690eb99172518269df
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-11-23T11:47:02-05:00

Commit Message:
XEEN: Fixes for initializing blacksmith wares

Changed paths:
    engines/xeen/character.cpp
    engines/xeen/party.cpp


diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp
index def830e..0114b0a 100644
--- a/engines/xeen/character.cpp
+++ b/engines/xeen/character.cpp
@@ -1666,20 +1666,15 @@ int Character::makeItem(int p1, int itemIndex, int p3) {
 			rval = vm->getRandomNumber(1, 100);
 			if (rval <= 25) {
 				mult = 0;
-			}
-			else if (rval <= 45) {
+			} else if (rval <= 45) {
 				mult = 1;
-			}
-			else if (rval <= 60) {
+			} else if (rval <= 60) {
 				mult = 2;
-			}
-			else if (rval <= 75) {
+			} else if (rval <= 75) {
 				mult = 3;
-			}
-			else if (rval <= 95) {
+			} else if (rval <= 95) {
 				mult = 4;
-			}
-			else {
+			} else {
 				mult = 5;
 			}
 
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 15e7b5f..45b85f2 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -1436,11 +1436,11 @@ void Party::resetBlacksmithWares() {
 
 		for (int idx2 = 0; idx2 < 4; ++idx2) {
 			for (int idx3 = 0; idx3 < BLACKSMITH_DATA1[idx2][idx1]; ++idx3) {
-				int itemCat = c.makeItem(idx2, 0, 0);
+				int itemCat = c.makeItem(idx2 + 1, 0, 0);
 				if (catCount[itemCat] < 8) {
 					switch (itemCat) {
 					case 0: {
-						XeenItem &item = _blacksmithWeapons[0][idx2 * 4 + catCount[itemCat]];
+						XeenItem &item = _blacksmithWeapons[0][catCount[itemCat] * 4 + idx1];
 						item._id = c._weapons[0]._id;
 						item._material = c._weapons[0]._material;
 						item._bonusFlags = c._weapons[0]._bonusFlags;
@@ -1448,7 +1448,7 @@ void Party::resetBlacksmithWares() {
 					}
 
 					case 1: {
-						XeenItem &item = _blacksmithArmor[0][idx2 * 4 + catCount[itemCat]];
+						XeenItem &item = _blacksmithArmor[0][catCount[itemCat] * 4 + idx1];
 						item._id = c._weapons[0]._id;
 						item._material = c._weapons[0]._material;
 						item._bonusFlags = c._weapons[0]._bonusFlags;
@@ -1456,7 +1456,7 @@ void Party::resetBlacksmithWares() {
 					}
 
 					case 2: {
-						XeenItem &item = _blacksmithAccessories[0][idx2 * 4 + catCount[itemCat]];
+						XeenItem &item = _blacksmithAccessories[0][catCount[itemCat] * 4 + idx1];
 						item._id = c._weapons[0]._id;
 						item._material = c._weapons[0]._material;
 						item._bonusFlags = c._weapons[0]._bonusFlags;
@@ -1464,7 +1464,7 @@ void Party::resetBlacksmithWares() {
 					}
 
 					case 3: {
-						XeenItem &item = _blacksmithMisc[0][idx2 * 4 + catCount[itemCat]];
+						XeenItem &item = _blacksmithMisc[0][catCount[itemCat] * 4 + idx1];
 						item._id = c._weapons[0]._id;
 						item._material = c._weapons[0]._material;
 						item._bonusFlags = c._weapons[0]._bonusFlags;
@@ -1490,7 +1490,7 @@ void Party::resetBlacksmithWares() {
 				if (catCount[itemCat] < 8) {
 					switch (itemCat) {
 					case 0: {
-						XeenItem &item = _blacksmithWeapons[1][idx2 * 4 + catCount[itemCat]];
+						XeenItem &item = _blacksmithWeapons[1][catCount[itemCat] * 4 + idx1];
 						item._id = c._weapons[0]._id;
 						item._material = c._weapons[0]._material;
 						item._bonusFlags = c._weapons[0]._bonusFlags;
@@ -1498,7 +1498,7 @@ void Party::resetBlacksmithWares() {
 					}
 
 					case 1: {
-						XeenItem &item = _blacksmithArmor[1][idx2 * 4 + catCount[itemCat]];
+						XeenItem &item = _blacksmithArmor[1][catCount[itemCat] * 4 + idx1];
 						item._id = c._weapons[0]._id;
 						item._material = c._weapons[0]._material;
 						item._bonusFlags = c._weapons[0]._bonusFlags;
@@ -1506,7 +1506,7 @@ void Party::resetBlacksmithWares() {
 					}
 
 					case 2: {
-						XeenItem &item = _blacksmithAccessories[1][idx2 * 4 + catCount[itemCat]];
+						XeenItem &item = _blacksmithAccessories[1][catCount[itemCat] * 4 + idx1];
 						item._id = c._weapons[0]._id;
 						item._material = c._weapons[0]._material;
 						item._bonusFlags = c._weapons[0]._bonusFlags;
@@ -1514,7 +1514,7 @@ void Party::resetBlacksmithWares() {
 					}
 
 					case 3: {
-						XeenItem &item = _blacksmithMisc[1][idx2 * 4 + catCount[itemCat]];
+						XeenItem &item = _blacksmithMisc[1][catCount[itemCat] * 4 + idx1];
 						item._id = c._weapons[0]._id;
 						item._material = c._weapons[0]._material;
 						item._bonusFlags = c._weapons[0]._bonusFlags;





More information about the Scummvm-git-logs mailing list