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

dreammaster dreammaster at scummvm.org
Fri Apr 6 04:14:36 CEST 2018


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

Summary:
8648a48080 XEEN: Move check code for nearby monsters to it's own method
c9460d1340 XEEN: Remove map load assert to allow Northern Sphinx map to load
b8d3bffc3a XEEN: Fix Barok giving Enchant Item spell to party


Commit: 8648a48080895308cf79c7fe99ecfebcb08c7528
    https://github.com/scummvm/scummvm/commit/8648a48080895308cf79c7fe99ecfebcb08c7528
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-05T20:06:14-04:00

Commit Message:
XEEN: Move check code for nearby monsters to it's own method

Changed paths:
    engines/xeen/combat.cpp
    engines/xeen/combat.h
    engines/xeen/party.cpp


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 2bd0187..e8ae670 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -2087,4 +2087,13 @@ void Combat::shootRangedWeapon() {
 	rangedAttack(POW_ARROW);
 }
 
+bool Combat::areMonstersPresent() const {
+	for (int idx = 0; idx < 26; ++idx) {
+		if (_attackMonsters[idx] != -1)
+			return true;
+	}
+
+	return false;
+}
+
 } // End of namespace Xeen
diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h
index 5d27dc5..deefe33 100644
--- a/engines/xeen/combat.h
+++ b/engines/xeen/combat.h
@@ -305,6 +305,11 @@ public:
 	 * Fires off a ranged attack at all oncoming monsters
 	 */
 	void shootRangedWeapon();
+
+	/**
+	 * Returns true if there are any monsters in the vacinity
+	 */
+	bool areMonstersPresent() const;
 };
 
 } // End of namespace Xeen
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 8852b51..d53c1f2 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -689,10 +689,7 @@ void Party::giveTreasure() {
 	if (!_treasure._hasItems && !_treasure._gold && !_treasure._gems)
 		return;
 
-	bool monstersPresent = false;
-	for (int idx = 0; idx < 26 && !monstersPresent; ++idx)
-		monstersPresent = combat._attackMonsters[idx] != -1;
-
+	bool monstersPresent = combat.areMonstersPresent();
 	if (_vm->_mode != MODE_RECORD_EVENTS && monstersPresent)
 		return;
 


Commit: c9460d1340ab29cd453a8e4547ee6abccc51093c
    https://github.com/scummvm/scummvm/commit/c9460d1340ab29cd453a8e4547ee6abccc51093c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-05T22:10:50-04:00

Commit Message:
XEEN: Remove map load assert to allow Northern Sphinx map to load

Changed paths:
    engines/xeen/map.cpp
    engines/xeen/scripts.cpp


diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 24a10bf..53b1632 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -463,8 +463,6 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData)
 			if (obj._id < (int)_objectSprites.size()) {
 				obj._spriteId = _objectSprites[obj._id]._spriteId;
 				obj._sprites = &_objectSprites[obj._id]._sprites;
-			} else {
-				assert(!obj._id);
 			}
 
 			_objects.push_back(obj);
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 202bbd0..82d5304 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -1617,7 +1617,7 @@ bool Scripts::ifProc(int action, uint32 val, int mode, int charIndex) {
 		v = party._gems;
 		break;
 	case 37:
-		// Might bonus (extra beond base)
+		// Might bonus (extra beyond base)
 		v = ps->_might._temporary;
 		break;
 	case 38:


Commit: b8d3bffc3ae385b3eb6655326d5bb889b6122408
    https://github.com/scummvm/scummvm/commit/b8d3bffc3ae385b3eb6655326d5bb889b6122408
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-05T22:14:33-04:00

Commit Message:
XEEN: Fix Barok giving Enchant Item spell to party

Changed paths:
    engines/xeen/party.cpp


diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index d53c1f2..50c5992 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -1154,14 +1154,16 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
 			ps._currentHp = 0;
 		break;
 	case 19: {
+		// Give spell to character
 		SpellsCategory category = ps.getSpellsCategory();
-		assert(category != SPELLCAT_INVALID);
 
-		for (int idx = 0; idx < SPELLS_PER_CLASS; ++idx) {
-			if (Res.SPELLS_ALLOWED[category][idx] == (int)giveVal) {
-				ps._spells[idx] = true;
-				intf.spellFX(&ps);
-				break;
+		if (category != SPELLCAT_INVALID) {
+			for (int idx = 0; idx < SPELLS_PER_CLASS; ++idx) {
+				if (Res.SPELLS_ALLOWED[category][idx] == (int)giveVal) {
+					ps._spells[idx] = true;
+					intf.spellFX(&ps);
+					break;
+				}
 			}
 		}
 		break;





More information about the Scummvm-git-logs mailing list