From 7aa31a838d6a529f2f287a642085d84b9c094d14 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 22 Jan 2021 13:38:05 +0100 Subject: [PATCH] Several fixes for attack effects not triggering. Signed-off-by: Deukhoofd --- CInterface/Library/AttackData.cpp | 2 +- src/Battling/Flow/TurnHandler.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CInterface/Library/AttackData.cpp b/CInterface/Library/AttackData.cpp index e076ec4..c426b66 100644 --- a/CInterface/Library/AttackData.cpp +++ b/CInterface/Library/AttackData.cpp @@ -15,7 +15,7 @@ export uint8_t CreatureLib_AttackData_Construct(AttackData*& out, const char* na } ArbUt::List 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); diff --git a/src/Battling/Flow/TurnHandler.cpp b/src/Battling/Flow/TurnHandler.cpp index 644f278..31e8615 100644 --- a/src/Battling/Flow/TurnHandler.cpp +++ b/src/Battling/Flow/TurnHandler.cpp @@ -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;