forked from metin2/server
1
0
Fork 0

fix out of order access of variables

This commit is contained in:
Tr0n 2024-04-09 18:13:14 +02:00
parent 854fef68e8
commit 4074c3b96a
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -205,15 +205,15 @@ int CalcMagicDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim)
float CalcAttackRating(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreTargetRating)
{
int iARSrc = std::min(90, (attacker_dx * 4 + attacker_lv * 2) / 6);
int iERSrc = std::min(90, (victim_dx * 4 + victim_lv * 2) / 6);
int attacker_dx = pkAttacker->GetPolymorphPoint(POINT_DX);
int attacker_lv = pkAttacker->GetLevel();
int victim_dx = pkVictim->GetPolymorphPoint(POINT_DX);
int victim_lv = pkAttacker->GetLevel();
int iARSrc = std::min(90, (attacker_dx * 4 + attacker_lv * 2) / 6);
int iERSrc = std::min(90, (victim_dx * 4 + victim_lv * 2) / 6);
float fAR = ((float) iARSrc + 210.0f) / 300.0f; // fAR = 0.7 ~ 1.0
if (bIgnoreTargetRating)