Fixes for GCC warnings
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
parent
762915b1f7
commit
4274a44fa5
|
@ -1,5 +1,4 @@
|
|||
/cmake-build-debug/
|
||||
/cmake-build-release/
|
||||
/cmake-build-*
|
||||
/build-release-windows/
|
||||
/.idea/
|
||||
/docs/
|
|
@ -78,9 +78,11 @@ void TurnHandler::ExecuteChoice(const ArbUt::BorrowedPtr<BaseTurnChoice>& choice
|
|||
#define FAIL_HANDLING(source, user, target) \
|
||||
battle.GetValue()->TriggerEventListener<FailEvent>(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) {
|
||||
auto battle = choice->GetUser()->GetBattle();
|
||||
|
@ -124,7 +126,7 @@ void TurnHandler::ExecuteAttackChoice(const ArbUt::BorrowedPtr<AttackTurnChoice>
|
|||
bool fail = false;
|
||||
HOOK(FailAttack, attack, attack, &fail);
|
||||
if (fail) {
|
||||
FAIL_HANDLING(attack, choice->GetUser(), (ScriptSource*)nullptr);
|
||||
FAIL_HANDLING_NO_TARGET(attack, choice->GetUser());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define HOOK(hookName, source, ...) \
|
||||
{ \
|
||||
try { \
|
||||
auto aggregator = source->GetScriptIterator(); \
|
||||
auto aggregator = (source)->GetScriptIterator(); \
|
||||
ArbUt::BorrowedPtr<CreatureLib::Battling::BattleScript> next = (CreatureLib::Battling::BattleScript*)1; \
|
||||
while (aggregator.GetNext(next)) { \
|
||||
try { \
|
||||
|
|
Loading…
Reference in New Issue