Simplify case SE_Illusion and SE_IllusionCopy for GetIllusionBlock

This commit is contained in:
nytmyr
2025-02-02 08:21:07 -06:00
parent 9b928e0725
commit db9fe0f284
+8 -18
View File
@@ -1481,15 +1481,10 @@ 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()) {
if (IsClient()) {
if (CastToClient()->GetIllusionBlock()) {
break;
}
}
else {
if (CastToBot()->GetIllusionBlock()) {
break;
}
auto target = IsClient() ? CastToClient() : CastToBot();
if (target && target->GetIllusionBlock()) {
break;
}
}
@@ -1503,15 +1498,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
snprintf(effect_desc, _EDLEN, "Illusion Copy");
#endif
if (caster && caster->IsOfClientBot()) {
if (IsClient()) {
if (CastToClient()->GetIllusionBlock()) {
break;
}
}
else {
if (CastToBot()->GetIllusionBlock()) {
break;
}
auto target = IsClient() ? CastToClient() : CastToBot();
if (target && target->GetIllusionBlock()) {
break;
}
}