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

dreammaster noreply at scummvm.org
Fri Feb 18 04:09:24 UTC 2022


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:
f9a2f7750b XEEN: More properly fixed the item drop range checks


Commit: f9a2f7750bee2134eb351f002de75863650337ac
    https://github.com/scummvm/scummvm/commit/f9a2f7750bee2134eb351f002de75863650337ac
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-02-17T20:08:42-08:00

Commit Message:
XEEN: More properly fixed the item drop range checks

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


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index d91a8e7da01..4dab1dd1325 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -101,7 +101,11 @@ static const int POW_WEAPON_VOCS[35] = {
 	5, 5, 5, 1, 3, 2, 5, 1, 1, 1, 0, 0, 0, 2, 2
 };
 
-static const int MONSTER_ITEM_RANGES[7] = { 10, 20, 50, 100, 100, 100, 0 };
+static const int MONSTER_ITEM_RANGES[21] = {
+	10, 20, 50, 100, 100, 100, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0
+};
 
 #define monsterSavingThrow(MONINDEX) (_vm->getRandomNumber(1, 50 + (MONINDEX)) <= (MONINDEX))
 
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 4ed6fa432a3..5a7a511bb96 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -123,6 +123,7 @@ void MonsterStruct::synchronize(Common::SeekableReadStream &s) {
 	_gold = s.readUint16LE();
 	_gems = s.readByte();
 	_itemDrop = s.readByte();
+	assert(_itemDrop >= 0 && _itemDrop <= 20);
 	_flying = s.readByte() != 0;
 	_imageNumber = s.readByte();
 	_loopAnimation = s.readByte();




More information about the Scummvm-git-logs mailing list