Make learned attacks on Creature be optional.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -51,7 +51,7 @@ namespace CreatureLib::Battling {
|
||||
ArbUt::StringView _overridenTalentName;
|
||||
std::unordered_set<ArbUt::BorrowedPtr<Creature>> _seenOpponents;
|
||||
|
||||
ArbUt::UniquePtrList<LearnedAttack> _attacks;
|
||||
ArbUt::OptionalUniquePtrList<LearnedAttack> _attacks;
|
||||
bool _allowedExperienceGain;
|
||||
|
||||
std::unique_ptr<Script> _status = nullptr;
|
||||
@@ -138,7 +138,7 @@ namespace CreatureLib::Battling {
|
||||
void RemoveVolatileScript(Script* script);
|
||||
bool HasVolatileScript(const ArbUt::BasicStringView& name) const;
|
||||
|
||||
const ArbUt::UniquePtrList<LearnedAttack>& GetAttacks() noexcept { return _attacks; }
|
||||
const ArbUt::OptionalUniquePtrList<LearnedAttack>& GetAttacks() noexcept { return _attacks; }
|
||||
bool HasAttack(const ArbUt::StringView& name) {
|
||||
for (auto& a : _attacks) {
|
||||
if (a == nullptr)
|
||||
|
||||
Reference in New Issue
Block a user