[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
+2 -2
View File
@@ -514,7 +514,7 @@ public:
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) = 0;
virtual 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) = 0;
virtual void SetHP(int64 hp);
void SetHP(int64 hp);
bool ChangeHP(Mob* other, int32 amount, uint16 spell_id = 0, int8 buffslot = -1, bool iBuffTic = false);
inline void SetOOCRegen(int64 new_ooc_regen) { ooc_regen = new_ooc_regen; }
virtual void Heal();
@@ -628,7 +628,7 @@ public:
virtual void SetEndurance(int32 newEnd) { return; }
int64 GetItemHPBonuses();
int64 GetSpellHPBonuses();
virtual const int64& SetMana(int64 amount);
const int64& SetMana(int64 amount);
inline float GetManaRatio() const { return max_mana == 0 ? 100 :
((static_cast<float>(current_mana) / max_mana) * 100); }
virtual int64 CalcMaxMana();