Pass ExecutingAttack values by reference instead of pointer.
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:
@@ -44,8 +44,9 @@ namespace CreatureLib::Battling {
|
||||
public:
|
||||
explicit TargetData(uint8_t numberOfHits) : _hits(numberOfHits) { _hits.Resize(numberOfHits, HitData()); }
|
||||
TargetData() = default;
|
||||
TargetData& operator=(const TargetData&) = delete;
|
||||
|
||||
HitData* GetHit(uint8_t index) { return &_hits[index]; }
|
||||
HitData& GetHit(uint8_t index) { return _hits[index]; }
|
||||
|
||||
uint8_t GetNumberOfHits() const noexcept { return _hits.Count(); }
|
||||
|
||||
@@ -71,7 +72,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
virtual ~ExecutingAttack() noexcept { delete _script; };
|
||||
|
||||
TargetData* GetAttackDataForTarget(Creature* creature) { return &_targets[creature]; }
|
||||
TargetData& GetAttackDataForTarget(Creature* creature) { return _targets[creature]; }
|
||||
|
||||
bool IsCreatureTarget(Creature* creature) noexcept { return _targets.Has(creature); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user