mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-09 12:22:51 +00:00
XEEN: Fix monster item drop probability checking
This commit is contained in:
parent
443852d9a9
commit
f4e448990d
1
NEWS.md
1
NEWS.md
@ -55,6 +55,7 @@ For a more comprehensive changelog of the latest experimental code, see:
|
||||
- Fix spell selection aborting when characters were switched.
|
||||
- Fixed some bad memory accesses.
|
||||
- Various sound fixes.
|
||||
- Fix the monster item drop probabilities.
|
||||
|
||||
macOS port:
|
||||
- Added support for displaying OSD messages on the Touch Bar.
|
||||
|
@ -102,7 +102,7 @@ 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[6] = { 10, 20, 50, 100, 100, 100 };
|
||||
static const int MONSTER_ITEM_RANGES[7] = { 10, 20, 50, 100, 100, 100, 0 };
|
||||
|
||||
#define monsterSavingThrow(MONINDEX) (_vm->getRandomNumber(1, 50 + (MONINDEX)) <= (MONINDEX))
|
||||
|
||||
@ -1526,7 +1526,7 @@ void Combat::attack2(int damage, RangeType rangeType) {
|
||||
|
||||
int itemDrop = monsterData._itemDrop;
|
||||
if (itemDrop) {
|
||||
if (MONSTER_ITEM_RANGES[itemDrop] >= _vm->getRandomNumber(1, 100)) {
|
||||
if (MONSTER_ITEM_RANGES[itemDrop - 1] >= _vm->getRandomNumber(1, 100)) {
|
||||
Character tempChar;
|
||||
int category = tempChar.makeItem(itemDrop, 0, 0);
|
||||
|
||||
|
@ -124,6 +124,7 @@ void MonsterStruct::synchronize(Common::SeekableReadStream &s) {
|
||||
_gold = s.readUint16LE();
|
||||
_gems = s.readByte();
|
||||
_itemDrop = s.readByte();
|
||||
assert(_itemDrop >= 0 && _itemDrop <= 7);
|
||||
_flying = s.readByte() != 0;
|
||||
_imageNumber = s.readByte();
|
||||
_loopAnimation = s.readByte();
|
||||
|
Loading…
x
Reference in New Issue
Block a user