Performance improvement for running turns by reducing the number of lookups for the hitdata.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -130,6 +130,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
|
||||
auto library = user->GetBattle()->GetLibrary();
|
||||
AssertNotNull(library)
|
||||
auto dmgLibrary = library->GetDamageLibrary();
|
||||
auto hitIterator = attack->GetTargetIteratorBegin(target);
|
||||
for (uint8_t hitIndex = 0; hitIndex < numberOfHits; hitIndex++) {
|
||||
if (user->IsFainted()) {
|
||||
break;
|
||||
@@ -137,7 +138,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
|
||||
if (target->IsFainted()) {
|
||||
break;
|
||||
}
|
||||
auto& hit = attack->GetHitData(target, hitIndex);
|
||||
auto& hit = *(hitIterator++);
|
||||
auto hitType = hit.GetType();
|
||||
HOOK(ChangeAttackType, targetSource, attack, target, hitIndex, &hitType);
|
||||
auto effectiveness = library->GetTypeLibrary()->GetEffectiveness(hitType, target->GetTypes());
|
||||
|
||||
Reference in New Issue
Block a user