From 3a5dd9e92f72a34bbc97f4e6ec205506149a01bb Mon Sep 17 00:00:00 2001 From: Juliano Leal Goncalves Date: Mon, 20 Sep 2021 00:34:27 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Ensure=20correct=20fire=20arrow?= =?UTF-8?q?=20damage=20range=20on=20player=20hits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a off-by-one mistake in fire arrow damage randomization logic that was preventing the final damage from ever being the maximum value of the range. For example, a 1-10 fire damage item would only ever do between 1 and 9 damage. --- Source/player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/player.cpp b/Source/player.cpp index 4e9d09579..90dd6d425 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -916,7 +916,7 @@ bool PlrHitMonst(int pnum, int m) } if ((player._pIFlags & ISPL_FIREDAM) != 0 && (player._pIFlags & ISPL_LIGHTDAM) != 0) { - int midam = player._pIFMinDam + GenerateRnd(player._pIFMaxDam - player._pIFMinDam); + int midam = player._pIFMinDam + GenerateRnd(player._pIFMaxDam - player._pIFMinDam + 1); AddMissile(player.position.tile, player.position.temp, player._pdir, MIS_SPECARROW, TARGET_MONSTERS, pnum, midam, 0); } int dam = player._pIDamage.GetValue(); @@ -1300,7 +1300,7 @@ bool DoRangeAttack(int pnum) mistype = MIS_LARROW; } if ((player._pIFlags & ISPL_FIRE_ARROWS) != 0 && (player._pIFlags & ISPL_LIGHT_ARROWS) != 0) { - dmg = player._pIFMinDam + GenerateRnd(player._pIFMaxDam - player._pIFMinDam); + dmg = player._pIFMinDam + GenerateRnd(player._pIFMaxDam - player._pIFMinDam + 1); mistype = MIS_SPECARROW; }