fix out of order access of variables
This commit is contained in:
parent
854fef68e8
commit
4074c3b96a
|
@ -205,15 +205,15 @@ int CalcMagicDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim)
|
||||||
|
|
||||||
float CalcAttackRating(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreTargetRating)
|
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_dx = pkAttacker->GetPolymorphPoint(POINT_DX);
|
||||||
int attacker_lv = pkAttacker->GetLevel();
|
int attacker_lv = pkAttacker->GetLevel();
|
||||||
|
|
||||||
int victim_dx = pkVictim->GetPolymorphPoint(POINT_DX);
|
int victim_dx = pkVictim->GetPolymorphPoint(POINT_DX);
|
||||||
int victim_lv = pkAttacker->GetLevel();
|
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
|
float fAR = ((float) iARSrc + 210.0f) / 300.0f; // fAR = 0.7 ~ 1.0
|
||||||
|
|
||||||
if (bIgnoreTargetRating)
|
if (bIgnoreTargetRating)
|
||||||
|
|
Loading…
Reference in New Issue