Tweaks for exception handling.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -19,7 +19,7 @@ bool Battle::CanUse(const ArbUt::BorrowedPtr<BaseTurnChoice>& choice) {
|
||||
}
|
||||
|
||||
bool Battle::TrySetChoice(BaseTurnChoice* choice) {
|
||||
AssertNotNull(choice)
|
||||
AssertNotNull(choice);
|
||||
if (!CanUse(choice))
|
||||
return false;
|
||||
choice->GetUser()->GetBattleSide()->SetChoice(choice);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "CreateCreature.hpp"
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
#include "../Library/BattleLibrary.hpp"
|
||||
|
||||
@@ -21,8 +22,9 @@ CreateCreature CreateCreature::WithGender(Library::Gender gender) {
|
||||
}
|
||||
|
||||
CreateCreature CreateCreature::WithAttack(const ArbUt::StringView& attackName, AttackLearnMethod learnMethod) {
|
||||
if (_attacks.Count() >= _library->GetSettings()->GetMaximalMoves())
|
||||
if (_attacks.Count() >= _library->GetSettings()->GetMaximalMoves()) {
|
||||
THROW_CREATURE("You have already set the maximum amount of allowed moves.");
|
||||
}
|
||||
|
||||
auto attackData = _library->GetAttackLibrary()->Get(attackName.GetHash());
|
||||
_attacks.Append(std::tuple(attackData, learnMethod));
|
||||
|
||||
Reference in New Issue
Block a user