More Assertions to validate state correctness.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
475392f9b6
commit
f190121e74
|
@ -103,6 +103,8 @@ void TurnHandler::ExecuteAttackChoice(AttackTurnChoice* choice) {
|
|||
void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* target,
|
||||
ExecutingAttack::TargetData* targetData) {
|
||||
auto user = attack->GetUser();
|
||||
AssertNotNull(user)
|
||||
AssertNotNull(target)
|
||||
|
||||
ScriptSource* targetSource = target;
|
||||
ScriptSource* userSource = attack;
|
||||
|
@ -131,6 +133,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
|
|||
return;
|
||||
auto attackData = attack->GetAttack()->GetAttack();
|
||||
auto library = user->GetBattle()->GetLibrary();
|
||||
AssertNotNull(library)
|
||||
auto dmgLibrary = library->GetDamageLibrary();
|
||||
for (uint8_t hitIndex = 0; hitIndex < numHits; hitIndex++) {
|
||||
if (user->IsFainted()) {
|
||||
|
@ -141,6 +144,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
|
|||
break;
|
||||
}
|
||||
auto hit = targetData->GetHit(hitIndex);
|
||||
AssertNotNull(hit)
|
||||
|
||||
auto hitType = hit->GetType();
|
||||
HOOK(ChangeAttackType, targetSource, attack, target, hitIndex, &hitType);
|
||||
|
|
Loading…
Reference in New Issue