Skip to content

Commit

Permalink
Fixed a bug where monster damage values from melee/missile hits could…
Browse files Browse the repository at this point in the history
… potentially add or subtract up to 63/64ths of damage over and above a monster's usual damage range
  • Loading branch information
SoundChaser83 committed Jan 7, 2022
1 parent c03cc84 commit f99be30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/missiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ bool PlayerMHit(int pnum, Monster *monster, int dist, int mind, int maxd, missil
dam = player._pHitPoints - 1;
} else {
if (!shift) {
dam = (mind << 6) + GenerateRnd((maxd - mind + 1) << 6);
dam = (mind << 6) + (GenerateRnd(maxd - mind + 1) << 6);
if (monster == nullptr)
if ((player._pIFlags & ISPL_ABSHALFTRAP) != 0)
dam /= 2;
Expand Down
2 changes: 1 addition & 1 deletion Source/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ void MonsterAttackPlayer(int i, int pnum, int hit, int minDam, int maxDam)
}
}
}
int dam = (minDam << 6) + GenerateRnd((maxDam - minDam + 1) << 6);
int dam = (minDam << 6) + (GenerateRnd(maxDam - minDam + 1) << 6);
dam = std::max(dam + (player._pIGetHit << 6), 64);
if (pnum == MyPlayerId) {
if (player.wReflections > 0)
Expand Down

0 comments on commit f99be30

Please sign in to comment.