Pass HitData as reference to damage calculation library, to prevent multiple lookup.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-25 16:51:10 +02:00
parent 864a9d933d
commit 8eb22ad68d
4 changed files with 36 additions and 27 deletions

View File

@@ -147,8 +147,8 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
HOOK(ChangeEffectiveness, attack, attack, target, hitIndex, &effectiveness)
hit.SetEffectiveness(effectiveness);
hit.SetCritical(library->GetMiscLibrary()->IsCritical(attack, target, hitIndex));
hit.SetBasePower(dmgLibrary->GetBasePower(attack, target, hitIndex));
hit.SetDamage(dmgLibrary->GetDamage(attack, target, hitIndex));
hit.SetBasePower(dmgLibrary->GetBasePower(attack, target, hitIndex, hit));
hit.SetDamage(dmgLibrary->GetDamage(attack, target, hitIndex, hit));
if (attackData->GetCategory() == Library::AttackCategory::Status) {
if (attackData->HasSecondaryEffect()) {