Implements replacement attack when an attack can't be used anymore, adds clearer exception handling.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-07-26 18:00:58 +02:00
parent 36f1e5beeb
commit 1d03adf0d1
2 changed files with 32 additions and 17 deletions

View File

@@ -14,7 +14,14 @@ void TurnHandler::RunTurn(ArbUt::BorrowedPtr<ChoiceQueue> queue) {
}
while (queue->HasNext()) {
auto item = queue->Dequeue();
ExecuteChoice(item.get());
try {
ExecuteChoice(item.get());
} catch (const std::exception& e) {
THROW_CREATURE("Executing choice failed for choice by mon on side "
<< item.get()->GetUser()->GetBattleSide()->GetSideIndex() << " and index "
<< item.get()->GetUser()->GetBattleSide()->GetCreatureIndex(item->GetUser())
<< " with message '" << e.what() << "'.");
}
}
queue->HasCompletedQueue = true;
}