From ddbf4c23b804da13e7c041fb76d5f5aeb9c14712 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 22 Apr 2020 12:54:11 +0200 Subject: [PATCH] Fix for compilation issue when using NO_ASSERT. --- src/Battling/Models/Battle.hpp | 5 ++--- src/Battling/Models/LearnedAttack.cpp | 2 +- src/Battling/Models/LearnedAttack.hpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Battling/Models/Battle.hpp b/src/Battling/Models/Battle.hpp index 65a82d7..d939096 100644 --- a/src/Battling/Models/Battle.hpp +++ b/src/Battling/Models/Battle.hpp @@ -39,10 +39,9 @@ namespace CreatureLib::Battling { : _library(library), _parties(std::move(parties)), _canFlee(canFlee), _numberOfSides(numberOfSides), _creaturesPerSide(creaturesPerSide) { AssertNotNull(_library) - for (auto p : parties) - AssertNotNull(p) + AssertAllNotNull(parties) - _sides = List(numberOfSides); + _sides = List(numberOfSides); for (size_t i = 0; i < numberOfSides; i++) { _sides[i] = new BattleSide(i, this, creaturesPerSide); } diff --git a/src/Battling/Models/LearnedAttack.cpp b/src/Battling/Models/LearnedAttack.cpp index 1be463f..a012027 100644 --- a/src/Battling/Models/LearnedAttack.cpp +++ b/src/Battling/Models/LearnedAttack.cpp @@ -1,6 +1,6 @@ #include "LearnedAttack.hpp" #include -CreatureLib::Battling::LearnedAttack::LearnedAttack(CreatureLib::Library::AttackData* attack, uint8_t maxUses, +CreatureLib::Battling::LearnedAttack::LearnedAttack(const CreatureLib::Library::AttackData* attack, uint8_t maxUses, AttackLearnMethod learnMethod) : _attack(attack), _maxUses(maxUses), _remainingUses(maxUses), _learnMethod(learnMethod) { AssertNotNull(_attack) diff --git a/src/Battling/Models/LearnedAttack.hpp b/src/Battling/Models/LearnedAttack.hpp index 1e6475a..a035b04 100644 --- a/src/Battling/Models/LearnedAttack.hpp +++ b/src/Battling/Models/LearnedAttack.hpp @@ -12,7 +12,7 @@ namespace CreatureLib::Battling { AttackLearnMethod _learnMethod; public: - LearnedAttack(Library::AttackData* attack, uint8_t maxUses, AttackLearnMethod learnMethod); + LearnedAttack(const Library::AttackData* attack, uint8_t maxUses, AttackLearnMethod learnMethod); LearnedAttack(const Library::AttackData* attack, AttackLearnMethod learnMethod); virtual ~LearnedAttack() = default;