diff --git a/zone/bot.cpp b/zone/bot.cpp index eaf6d19b1..277d06605 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9644,16 +9644,15 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck return false; } - if ( - spells[spell_id].target_type == ST_Self && - tar != this && - ( - spell_type != BotSpellTypes::SummonCorpse || - RuleB(Bots, AllowCommandedSummonCorpse) - ) - ) { - LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to ST_Self.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); - return false; + if (spells[spell_id].target_type == ST_Self && tar != this) { + if (spell_type == BotSpellTypes::SummonCorpse && RuleB(Bots, AllowCommandedSummonCorpse)) { + // Don't cancel (Summon Corpse is allowed) + } + else { + LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to ST_Self.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); + + return false; + } } if ( diff --git a/zone/spells.cpp b/zone/spells.cpp index bcd89c5bf..e5dc8e1dd 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -779,12 +779,7 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp if (IsGroupSpell(spell_id)) { return true; } else if (spells[spell_id].target_type == ST_Self) { - if (IsBot() && (IsEffectInSpell(spell_id, SE_SummonCorpse) && RuleB(Bots, AllowCommandedSummonCorpse))) { - //spell_target = this; - } - else { - spell_target = this; - } + spell_target = this; } } else { if (IsGroupSpell(spell_id) && spell_target != this) { @@ -1925,10 +1920,13 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce // single target spells case ST_Self: { - if (IsBot() && (IsEffectInSpell(spell_id, SE_SummonCorpse) && RuleB(Bots, AllowCommandedSummonCorpse))) { - //spell_target = this; - } - else { + if ( + !( + IsBot() && + IsEffectInSpell(spell_id, SE_SummonCorpse) && + RuleB(Bots, AllowCommandedSummonCorpse) + ) + ) { // summon corpse spells are self only, bots need a fallthrough to summon corpses spell_target = this; }