Fix casting for GetIllusionBlock checks

This commit is contained in:
nytmyr
2025-02-02 09:08:42 -06:00
parent 23960b9c77
commit d71e121c89
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -647,7 +647,7 @@ public:
uint8 GetUltimateSpellTypeMinThreshold(uint16 spell_type, Mob* tar);
uint8 GetUltimateSpellTypeMaxThreshold(uint16 spell_type, Mob* tar);
void SetIllusionBlock(bool value) { _illusionBlock = value; }
bool GetIllusionBlock() const { return _illusionBlock; }
bool GetIllusionBlock() const override { return _illusionBlock; }
bool GetShowHelm() const { return _showHelm; }
void SetShowHelm(bool show_helm) { _showHelm = show_helm; }
bool GetBehindMob() const { return _behindMobStatus; }
+1 -1
View File
@@ -2299,7 +2299,7 @@ public:
void SetSpellTypeRecastTimer(uint16 spell_type, uint32 recast_time) { m_bot_spell_settings[spell_type].recast_timer.Start(recast_time); }
void SetIllusionBlock(bool value) { _illusionBlock = value; }
bool GetIllusionBlock() const { return _illusionBlock; }
bool GetIllusionBlock() const override { return _illusionBlock; }
private:
bool bot_owner_options[_booCount];
+1
View File
@@ -514,6 +514,7 @@ public:
void ApplySpellBuff(int spell_id, int duration = 0, int level_override = -1);
int GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier);
int GetBuffStatValueBySlot(uint8 slot, const char* stat_identifier);
virtual bool GetIllusionBlock() const { return false; }
//Basic Stats/Inventory
virtual void SetLevel(uint8 in_level, bool command = false) { level = in_level; }
+2 -2
View File
@@ -1481,7 +1481,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
snprintf(effect_desc, _EDLEN, "Illusion: race %d", effect_value);
#endif
if (caster && caster->IsOfClientBot()) {
auto target = IsClient() ? CastToClient() : CastToBot();
Mob* target = IsClient() ? static_cast<Mob*>(CastToClient()) : static_cast<Mob*>(CastToBot());
if (target && target->GetIllusionBlock()) {
break;
@@ -1498,7 +1498,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
snprintf(effect_desc, _EDLEN, "Illusion Copy");
#endif
if (caster && caster->IsOfClientBot()) {
auto target = IsClient() ? CastToClient() : CastToBot();
Mob* target = IsClient() ? static_cast<Mob*>(CastToClient()) : static_cast<Mob*>(CastToBot());
if (target && target->GetIllusionBlock()) {
break;