mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 08:11:30 +00:00
[Bug Fix] PR 2032 would lock client on casting fail as written (#2038)
This commit is contained in:
parent
4e40d7eacc
commit
f814b5bec5
@ -182,20 +182,25 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
|||||||
//Goal of Spells:UseSpellImpliedTargeting is to replicate the EQ2 feature where spells will 'pass through' invalid targets to target's target to try to find a valid target.
|
//Goal of Spells:UseSpellImpliedTargeting is to replicate the EQ2 feature where spells will 'pass through' invalid targets to target's target to try to find a valid target.
|
||||||
if (RuleB(Spells,UseSpellImpliedTargeting) && IsClient()) {
|
if (RuleB(Spells,UseSpellImpliedTargeting) && IsClient()) {
|
||||||
Mob* spell_target = entity_list.GetMobID(target_id);
|
Mob* spell_target = entity_list.GetMobID(target_id);
|
||||||
if (spell_target && spell_target->GetTarget()) {
|
if (spell_target) {
|
||||||
|
Mob* targets_target = spell_target->GetTarget();
|
||||||
|
if (targets_target) {
|
||||||
// If either this is beneficial and the target is not a player or player's pet or vis versa
|
// If either this is beneficial and the target is not a player or player's pet or vis versa
|
||||||
if ((IsBeneficialSpell(spell_id) && (!(spell_target->IsClient() || (spell_target->HasOwner() && spell_target->GetOwner()->IsClient()))))
|
if ((IsBeneficialSpell(spell_id) && (!(spell_target->IsClient() || (spell_target->HasOwner() && spell_target->GetOwner()->IsClient()))))
|
||||||
|| (IsDetrimentalSpell(spell_id) && (spell_target->IsClient() || (spell_target->HasOwner() && spell_target->GetOwner()->IsClient())))) {
|
|| (IsDetrimentalSpell(spell_id) && (spell_target->IsClient() || (spell_target->HasOwner() && spell_target->GetOwner()->IsClient())))) {
|
||||||
//Check if the target's target is a valid target; we can use DoCastingChecksOnTarget() here because we can let it handle the failure as vanilla would
|
//Check if the target's target is a valid target; we can use DoCastingChecksOnTarget() here because we can let it handle the failure as vanilla would
|
||||||
if (DoCastingChecksOnTarget(true, spell_id, spell_target->GetTarget())) {
|
if (DoCastingChecksOnTarget(true, spell_id, targets_target)) {
|
||||||
target_id = spell_target->GetTarget()->GetID();
|
target_id = targets_target->GetID();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//Just return false here because we are going to fail the next check block anyway if we reach this point.
|
//Just return false here because we are going to fail the next check block anyway if we reach this point.
|
||||||
|
StopCastSpell(spell_id, send_spellbar_enable);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!DoCastingChecksOnCaster(spell_id, slot) ||
|
if (!DoCastingChecksOnCaster(spell_id, slot) ||
|
||||||
!DoCastingChecksZoneRestrictions(true, spell_id) ||
|
!DoCastingChecksZoneRestrictions(true, spell_id) ||
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user