Several fixes for attack effects not triggering.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-01-22 13:38:05 +01:00
parent abccc23851
commit 7aa31a838d
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ export uint8_t CreatureLib_AttackData_Construct(AttackData*& out, const char* na
}
ArbUt::List<EffectParameter*> effectParameterList(effectParameterCount);
for (size_t i = 0; i < effectParameterCount; i++) {
effectParameterList[i] = effectParameters[i];
effectParameterList.Append(effectParameters[i]);
}
auto effect = new SecondaryEffect(effectChance, ArbUt::StringView(effectName), effectParameterList);

View File

@ -191,7 +191,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo
battle.GetValue()->GetRandom()->EffectChance(effect->GetChance(), attack, target.GetRaw());
}
if (hasSecondaryEffect) {
HOOK(OnSecondaryEffect, user, attack, target.GetRaw(), hitIndex);
HOOK(OnSecondaryEffect, attack, attack, target.GetRaw(), hitIndex);
}
} catch (const ArbUt::Exception& e) {
throw e;
@ -223,7 +223,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo
hasSecondaryEffect = random->EffectChance(effect->GetChance(), attack, target.GetRaw());
}
if (hasSecondaryEffect) {
HOOK(OnSecondaryEffect, user, attack, target.GetRaw(), hitIndex);
HOOK(OnSecondaryEffect, attack, attack, target.GetRaw(), hitIndex);
}
} catch (const ArbUt::Exception& e) {
throw e;