Browse Source

♻️ Remove monsterId from CheckReflect (#5071)

pull/5068/head
Cesar Canassa 4 years ago committed by GitHub
parent
commit
c6561596b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      Source/monster.cpp

7
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);
}

Loading…
Cancel
Save