Fixes for GCC warnings
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-06-26 11:26:20 +02:00
parent 762915b1f7
commit 4274a44fa5
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
3 changed files with 8 additions and 7 deletions

3
.gitignore vendored
View File

@ -1,5 +1,4 @@
/cmake-build-debug/ /cmake-build-*
/cmake-build-release/
/build-release-windows/ /build-release-windows/
/.idea/ /.idea/
/docs/ /docs/

View File

@ -78,9 +78,11 @@ void TurnHandler::ExecuteChoice(const ArbUt::BorrowedPtr<BaseTurnChoice>& choice
#define FAIL_HANDLING(source, user, target) \ #define FAIL_HANDLING(source, user, target) \
battle.GetValue()->TriggerEventListener<FailEvent>(user); \ battle.GetValue()->TriggerEventListener<FailEvent>(user); \
HOOK(OnFail, source, user) \ HOOK(OnFail, source, user) \
if ((target) != (void*)0) { \ HOOK(OnOpponentFail, target, user)
HOOK(OnOpponentFail, (target), user) \
} #define FAIL_HANDLING_NO_TARGET(source, user) \
battle.GetValue()->TriggerEventListener<FailEvent>(user); \
HOOK(OnFail, source, user)
void TurnHandler::ExecuteAttackChoice(const ArbUt::BorrowedPtr<AttackTurnChoice>& choice) { void TurnHandler::ExecuteAttackChoice(const ArbUt::BorrowedPtr<AttackTurnChoice>& choice) {
auto battle = choice->GetUser()->GetBattle(); auto battle = choice->GetUser()->GetBattle();
@ -124,7 +126,7 @@ void TurnHandler::ExecuteAttackChoice(const ArbUt::BorrowedPtr<AttackTurnChoice>
bool fail = false; bool fail = false;
HOOK(FailAttack, attack, attack, &fail); HOOK(FailAttack, attack, attack, &fail);
if (fail) { if (fail) {
FAIL_HANDLING(attack, choice->GetUser(), (ScriptSource*)nullptr); FAIL_HANDLING_NO_TARGET(attack, choice->GetUser());
return; return;
} }

View File

@ -1,7 +1,7 @@
#define HOOK(hookName, source, ...) \ #define HOOK(hookName, source, ...) \
{ \ { \
try { \ try { \
auto aggregator = source->GetScriptIterator(); \ auto aggregator = (source)->GetScriptIterator(); \
ArbUt::BorrowedPtr<CreatureLib::Battling::BattleScript> next = (CreatureLib::Battling::BattleScript*)1; \ ArbUt::BorrowedPtr<CreatureLib::Battling::BattleScript> next = (CreatureLib::Battling::BattleScript*)1; \
while (aggregator.GetNext(next)) { \ while (aggregator.GetNext(next)) { \
try { \ try { \