Make ExecutingAttack have raw pointer array HitData, instead of a List. This is a very hot segment of code, and removing surrounding abstractions can give us a decent amount of performance.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-05-27 18:26:09 +02:00
parent 90e7a699bc
commit fcc6f2214e
3 changed files with 12 additions and 8 deletions

View File

@@ -138,9 +138,10 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
if (target->IsFainted()) {
break;
}
auto& hit = *(hitIterator++);
auto hitType = hit.GetType();
auto& hit = hitIterator[hitIndex];
uint8_t hitType = hit.GetType();
HOOK(ChangeAttackType, targetSource, attack, target, hitIndex, &hitType);
hit.SetType(hitType);
auto effectiveness = library->GetTypeLibrary()->GetEffectiveness(hitType, target->GetTypes());
HOOK(ChangeEffectiveness, attack, attack, target, hitIndex, &effectiveness)
hit.SetEffectiveness(effectiveness);