refactor(Core/BossAI): Improve the ScheduleHealthCheck() code (#19743)

* refactor(Core/BossAI): Improve the ScheduleHealthCheck() code

* Update ScriptedCreature.cpp

---------

Co-authored-by: sudlud <sudlud@users.noreply.github.com>
This commit is contained in:
Andrew
2024-08-26 14:44:05 -03:00
committed by GitHub
parent 4ed1815de6
commit 83f8871c31
2 changed files with 12 additions and 14 deletions

View File

@@ -449,10 +449,11 @@ private:
struct HealthCheckEventData
{
HealthCheckEventData(uint8 healthPct, std::function<void()> exec) : _healthPct(healthPct), _exec(exec) { };
HealthCheckEventData(uint8 healthPct, std::function<void()> exec, bool valid = true) : _healthPct(healthPct), _exec(exec), _valid(valid) { };
uint8 _healthPct;
std::function<void()> _exec;
bool _valid;
};
class BossAI : public ScriptedAI
@@ -497,7 +498,6 @@ protected:
void _JustDied();
void _JustReachedHome() { me->setActive(false); }
void _EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER);
[[nodiscard]] bool _ProccessHealthCheckEvent(uint8 healthPct, uint32 damage, std::function<void()> exec) const;
void TeleportCheaters();