[Crash] Fix Bot Crash in Bot::Bot Constructor. (#2868)

* [Crash] Fix Bot Crash in Bot::Bot Constructor.

* fix another potential crash in bot contructor.
This commit is contained in:
Aeadoin
2023-02-12 14:27:29 -05:00
committed by GitHub
parent 9825c61a13
commit 924e91cf64
3 changed files with 40 additions and 35 deletions
+21 -11
View File
@@ -147,10 +147,10 @@ public:
void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1,
bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) override;
bool HasRaid() override { return (GetRaid() ? true : false); }
bool HasGroup() override { return (GetGroup() ? true : false); }
Raid* GetRaid() override { return entity_list.GetRaidByMob(this); }
Group* GetGroup() override { return entity_list.GetGroupByMob(this); }
bool HasRaid() final { return (GetRaid() ? true : false); }
bool HasGroup() final { return (GetGroup() ? true : false); }
Raid* GetRaid() final { return entity_list.GetRaidByMob(this); }
Group* GetGroup() final { return entity_list.GetGroupByMob(this); }
// Common, but informal "interfaces" with Client object
uint32 CharacterID() { return GetBotID(); } // Just returns the Bot Id
@@ -354,8 +354,8 @@ public:
void AI_Bot_Start(uint32 iMoveDelay = 0);
// Mob AI Virtual Override Methods
void AI_Process() override;
void AI_Stop() override;
void AI_Process() final;
void AI_Stop() final;
// Mob Spell Virtual Override Methods
void SpellProcess() override;
@@ -365,7 +365,17 @@ public:
void DoBuffTic(const Buffs_Struct &buff, int slot, Mob* caster = nullptr) override;
virtual bool CastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0,
uint32 item_slot = 0xFFFFFFFF, int16 *resist_adjust = nullptr, uint32 aa_id = 0);
virtual bool SpellOnTarget(uint16 spell_id, Mob* spelltar);
bool SpellOnTarget(
uint16 spell_id,
Mob* spelltar,
int reflect_effectiveness = 0,
bool use_resist_adjust = false,
int16 resist_adjust = 0,
bool isproc = false,
int level_override = -1,
int duration_override = 0,
bool disable_buff_overwrite = false
) final;
bool IsImmuneToSpell(uint16 spell_id, Mob *caster) override;
virtual bool DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, EQ::spells::CastingSlot slot);
virtual bool DoCastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1,
@@ -376,10 +386,10 @@ public:
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) override
{ return Mob::Attack(other, Hand, FromRiposte, IsStrikethrough, IsFromSpell, opts); }
[[nodiscard]] int GetMaxBuffSlots() const override { return EQ::spells::LONG_BUFFS; }
[[nodiscard]] int GetMaxSongSlots() const override { return EQ::spells::SHORT_BUFFS; }
[[nodiscard]] int GetMaxDiscSlots() const override { return EQ::spells::DISC_BUFFS; }
[[nodiscard]] int GetMaxTotalSlots() const override { return EQ::spells::TOTAL_BUFFS; }
[[nodiscard]] int GetMaxBuffSlots() const final { return EQ::spells::LONG_BUFFS; }
[[nodiscard]] int GetMaxSongSlots() const final { return EQ::spells::SHORT_BUFFS; }
[[nodiscard]] int GetMaxDiscSlots() const final { return EQ::spells::DISC_BUFFS; }
[[nodiscard]] int GetMaxTotalSlots() const final { return EQ::spells::TOTAL_BUFFS; }
bool GetBotOwnerDataBuckets();
bool GetBotDataBuckets();