[Bug Fix] Spells - Self Only (Yellow) cast when non group member is targeted (#4503)

* [Bug Fix] Spells - Self Only (Yellow) cast when non group member is targeted

When using a Yellow gem invis spell, it should cast on yourself regardless of the targetted entity.

* Update spells.cpp

---------

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
Fryguy 2024-10-10 21:27:49 -04:00 committed by GitHub
parent 178129443f
commit 8f86cb353e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -821,14 +821,12 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp
} }
if (!spell_target) { if (!spell_target) {
if (IsGroupSpell(spell_id)){ if (IsGroupSpell(spell_id)) {
return true; return true;
} } else if (spells[spell_id].target_type == ST_Self) {
else if (spells[spell_id].target_type == ST_Self) {
spell_target = this; spell_target = this;
} }
} } else {
else {
if (IsGroupSpell(spell_id) && spell_target != this) { if (IsGroupSpell(spell_id) && spell_target != this) {
ignore_on_casting = true; ignore_on_casting = true;
} }
@ -942,7 +940,13 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp
/* /*
Requires target to be in same group or same raid in order to apply invisible. Requires target to be in same group or same raid in order to apply invisible.
*/ */
if (check_on_casting && RuleB(Spells, InvisRequiresGroup) && IsInvisibleSpell(spell_id)) { if (
check_on_casting &&
spells[spell_id].target_type != ST_Self &&
GetTarget() != this &&
RuleB(Spells, InvisRequiresGroup) &&
IsInvisibleSpell(spell_id)
) {
if (IsClient() && spell_target && spell_target->IsClient()) { if (IsClient() && spell_target && spell_target->IsClient()) {
if (spell_target && spell_target->GetID() != GetID()) { if (spell_target && spell_target->GetID() != GetID()) {
bool cast_failed = true; bool cast_failed = true;
@ -954,8 +958,7 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp
(target_group->GetID() == my_group->GetID())) { (target_group->GetID() == my_group->GetID())) {
cast_failed = false; cast_failed = false;
} }
} } else if (spell_target->IsRaidGrouped()) {
else if (spell_target->IsRaidGrouped()) {
Raid *target_raid = spell_target->GetRaid(); Raid *target_raid = spell_target->GetRaid();
Raid *my_raid = GetRaid(); Raid *my_raid = GetRaid();
if (target_raid && if (target_raid &&