Further work on better exceptions.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-07-26 17:41:11 +02:00
parent 29eb7c603a
commit 36f1e5beeb
12 changed files with 30 additions and 37 deletions

View File

@@ -30,7 +30,7 @@ void BattleSide::SetChoice(BaseTurnChoice* choice) {
AssertNotNull(choice)
auto find = std::find(_creatures.begin(), _creatures.end(), choice->GetUser());
if (find == _creatures.end())
throw CreatureException("User not found");
THROW_CREATURE("User not found");
uint8_t index = std::distance(_creatures.begin(), find);
_choices[index] = std::shared_ptr<BaseTurnChoice>(choice);
_choicesSet++;