mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +00:00
Fix for bolt spell targeting self if target zone/died while casting.
Fix for bolt spell targeting self if target zone/died while casting. Despite the name being "ST_TargetOptional", this target type is reserved for projectile spells which all require a target, thus should be treated like any other targeted spell.
This commit is contained in:
+7
-4
@@ -406,8 +406,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
spell.targettype == ST_Self ||
|
||||
spell.targettype == ST_AECaster ||
|
||||
spell.targettype == ST_Ring ||
|
||||
spell.targettype == ST_Beam ||
|
||||
spell.targettype == ST_TargetOptional) && target_id == 0)
|
||||
spell.targettype == ST_Beam) && target_id == 0)
|
||||
{
|
||||
LogSpells("Spell [{}] auto-targeted the caster. Group? [{}], target type [{}]", spell_id, IsGroupSpell(spell_id), spell.targettype);
|
||||
target_id = GetID();
|
||||
@@ -1585,8 +1584,12 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
|
||||
case ST_TargetOptional:
|
||||
{
|
||||
if(!spell_target)
|
||||
spell_target = this;
|
||||
if (!spell_target)
|
||||
{
|
||||
LogSpells("Spell [{}] canceled: invalid target (normal)", spell_id);
|
||||
MessageString(Chat::Red, SPELL_NEED_TAR);
|
||||
return false; // can't cast these unless we have a target
|
||||
}
|
||||
CastAction = SingleTarget;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user