From c6561596b536f23c2cbc52dc0691de21bdd0025d Mon Sep 17 00:00:00 2001 From: Cesar Canassa Date: Wed, 20 Jul 2022 12:31:57 +0200 Subject: [PATCH] :recycle: Remove monsterId from CheckReflect (#5071) --- Source/monster.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 3725812a4..71afe7053 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -1231,9 +1231,8 @@ void MonsterAttackMonster(int i, int mid, int hper, int mind, int maxd) } } -void CheckReflect(int monsterId, int pnum, int dam) +void CheckReflect(Monster &monster, int pnum, int dam) { - auto &monster = Monsters[monsterId]; Player &player = Players[pnum]; player.wReflections--; @@ -1301,7 +1300,7 @@ void MonsterAttackPlayer(int monsterId, int pnum, int hit, int minDam, int maxDa if (&player == MyPlayer && player.wReflections > 0) { int dam = GenerateRnd(((maxDam - minDam) << 6) + 1) + (minDam << 6); dam = std::max(dam + (player._pIGetHit << 6), 64); - CheckReflect(monsterId, pnum, dam); + CheckReflect(monster, pnum, dam); } return; } @@ -1323,7 +1322,7 @@ void MonsterAttackPlayer(int monsterId, int pnum, int hit, int minDam, int maxDa dam = std::max(dam + (player._pIGetHit << 6), 64); if (&player == MyPlayer) { if (player.wReflections > 0) - CheckReflect(monsterId, pnum, dam); + CheckReflect(monster, pnum, dam); ApplyPlrDamage(player, 0, 0, dam); }