From d71e121c89a211d18aa5ee9c6b8cb3e69d28753d Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sun, 2 Feb 2025 09:08:42 -0600 Subject: [PATCH] Fix casting for GetIllusionBlock checks --- zone/bot.h | 2 +- zone/client.h | 2 +- zone/mob.h | 1 + zone/spell_effects.cpp | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/zone/bot.h b/zone/bot.h index 757818bde..ec7a441ff 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -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; } diff --git a/zone/client.h b/zone/client.h index ce4e5aa61..cc1378319 100644 --- a/zone/client.h +++ b/zone/client.h @@ -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]; diff --git a/zone/mob.h b/zone/mob.h index 961a0abfd..0b72354a3 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -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; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index b148d6cff..2365fa2fc 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -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(CastToClient()) : static_cast(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(CastToClient()) : static_cast(CastToBot()); if (target && target->GetIllusionBlock()) { break;