Check if the user is usable when we set the choice
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-05-15 11:24:21 +02:00
parent f13b78e297
commit dcf6b20e65

View File

@@ -10,6 +10,9 @@ using namespace CreatureLib::Battling;
const ArbUt::BorrowedPtr<const BattleLibrary>& Battle::GetLibrary() const noexcept { return _library; } const ArbUt::BorrowedPtr<const BattleLibrary>& Battle::GetLibrary() const noexcept { return _library; }
bool Battle::CanUse(const ArbUt::BorrowedPtr<BaseTurnChoice>& choice) { bool Battle::CanUse(const ArbUt::BorrowedPtr<BaseTurnChoice>& choice) {
if (!choice->GetUser()->IsUsable()) {
return false;
}
if (choice->GetKind() == TurnChoiceKind::Attack) { if (choice->GetKind() == TurnChoiceKind::Attack) {
auto attack = choice.ForceAs<AttackTurnChoice>(); auto attack = choice.ForceAs<AttackTurnChoice>();
// HOOK: change number of uses needed. // HOOK: change number of uses needed.