Adds Miss event.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-08-13 11:17:04 +02:00
parent bb35248174
commit 50236f4ece
3 changed files with 12 additions and 2 deletions

View File

@@ -122,7 +122,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo
if (user->GetBattle()->HasEnded())
return;
auto targetSource = target;
const auto& targetSource = target;
auto userSource = attack;
bool fail = false;
@@ -142,6 +142,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo
auto numberOfHits = attack->GetNumberOfHits();
if (numberOfHits == 0) {
HOOK(OnAttackMiss, targetSource, attack, target.GetRaw());
user->GetBattle()->TriggerEventListener<MissEvent>(user);
return;
}