Fix issues.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-03 18:32:03 +01:00
parent 59f7d3aa4f
commit c6620021a7
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 8 additions and 8 deletions

View File

@ -52,7 +52,7 @@ void TurnHandler::ExecuteChoice(BaseTurnChoice* choice) {
void TurnHandler::ExecuteAttackChoice(AttackTurnChoice* choice) { void TurnHandler::ExecuteAttackChoice(AttackTurnChoice* choice) {
auto attackName = choice->GetAttack()->GetAttack()->GetName(); auto attackName = choice->GetAttack()->GetAttack()->GetName();
HOOK(ChangeAttack, choice, choice, attackName); HOOK(ChangeAttack, choice, choice, &attackName);
if (attackName != choice->GetAttack()->GetAttack()->GetName()) { if (attackName != choice->GetAttack()->GetAttack()->GetName()) {
// TODO: Change attack // TODO: Change attack
} }
@ -63,7 +63,7 @@ void TurnHandler::ExecuteAttackChoice(AttackTurnChoice* choice) {
auto attack = new ExecutingAttack(targets, 1, choice->GetUser(), choice->GetAttack(), choice->GetAttackScript()); auto attack = new ExecutingAttack(targets, 1, choice->GetUser(), choice->GetAttack(), choice->GetAttackScript());
bool prevented = false; bool prevented = false;
HOOK(PreventAttack, attack, attack, prevented); HOOK(PreventAttack, attack, attack, &prevented);
if (prevented) { if (prevented) {
return; return;
} }
@ -76,7 +76,7 @@ void TurnHandler::ExecuteAttackChoice(AttackTurnChoice* choice) {
// HOOK: check if attack fails // HOOK: check if attack fails
bool fail = false; bool fail = false;
HOOK(FailAttack, attack, attack, fail); HOOK(FailAttack, attack, attack, &fail);
if (fail) { if (fail) {
// TODO: Fail handling. // TODO: Fail handling.
return; return;
@ -101,14 +101,14 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
ScriptSource* userSource = attack; ScriptSource* userSource = attack;
bool fail = false; bool fail = false;
HOOK(FailIncomingAttack, targetSource, attack, target, fail); HOOK(FailIncomingAttack, targetSource, attack, target, &fail);
if (fail) { if (fail) {
// TODO: Fail handling. // TODO: Fail handling.
return; return;
} }
bool invulnerable = fail; bool invulnerable = fail;
HOOK(IsInvulnerable, targetSource, attack, target, invulnerable); HOOK(IsInvulnerable, targetSource, attack, target, &invulnerable);
if (invulnerable) { if (invulnerable) {
// TODO: We should probably do something when a target is invulnerable. // TODO: We should probably do something when a target is invulnerable.
return; return;
@ -136,7 +136,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
auto hit = targetData->GetHit(hitIndex); auto hit = targetData->GetHit(hitIndex);
auto hitType = hit->GetType(); auto hitType = hit->GetType();
HOOK(ChangeAttackType, targetSource, attack, target, hitIndex, hitType); HOOK(ChangeAttackType, targetSource, attack, target, hitIndex, &hitType);
hit->SetEffectiveness(library->GetTypeLibrary()->GetEffectiveness(hitType, target->GetTypes())); hit->SetEffectiveness(library->GetTypeLibrary()->GetEffectiveness(hitType, target->GetTypes()));
hit->SetCritical(library->GetMiscLibrary()->IsCritical(attack, target, hitIndex)); hit->SetCritical(library->GetMiscLibrary()->IsCritical(attack, target, hitIndex));
hit->SetBasePower(dmgLibrary->GetBasePower(attack, target, hitIndex)); hit->SetBasePower(dmgLibrary->GetBasePower(attack, target, hitIndex));
@ -154,7 +154,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
target->Damage(damage, DamageSource::AttackDamage); target->Damage(damage, DamageSource::AttackDamage);
bool preventSecondary = false; bool preventSecondary = false;
HOOK(PreventSecondaryEffects, targetSource, attack, target, hitIndex, preventSecondary); HOOK(PreventSecondaryEffects, targetSource, attack, target, hitIndex, &preventSecondary);
if (!preventSecondary) { if (!preventSecondary) {
HOOK(OnSecondaryEffect, userSource, attack, target, hitIndex); HOOK(OnSecondaryEffect, userSource, attack, target, hitIndex);
} }
@ -169,7 +169,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
void TurnHandler::ExecuteSwitchChoice(CreatureLib::Battling::SwitchTurnChoice* choice) { void TurnHandler::ExecuteSwitchChoice(CreatureLib::Battling::SwitchTurnChoice* choice) {
bool preventSwitch = false; bool preventSwitch = false;
HOOK(PreventSelfSwitch, choice, choice, preventSwitch); HOOK(PreventSelfSwitch, choice, choice, &preventSwitch);
if (preventSwitch) { if (preventSwitch) {
return; return;
} }