Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core/Spells: Fixed logic for GetSpellXSpellVisualId #29927

Merged
merged 6 commits into from Apr 20, 2024

Conversation

mdX7
Copy link
Member

@mdX7 mdX7 commented Apr 17, 2024

  • fixes some spell visuals not being shown

Info:
Due to the previous code creatures would always reach !caster->IsPlayer() which would result in skipping the loop iteration and ultimatively returning 0 as spell visual.

        if (!caster || !caster->IsPlayer() || !ConditionMgr::IsPlayerMeetingCondition(caster->ToPlayer(), visual->CasterPlayerConditionID))
            continue;

Alternative solution:

        if (!caster || (caster->IsPlayer() && !ConditionMgr::IsPlayerMeetingCondition(caster->ToPlayer(), visual->CasterPlayerConditionID)))
            continue;

Tests performed:
built, tested ingame with spellids 111217 and 111219

* fixes some spell visuals not being shown
@aquadeus
Copy link
Contributor

this fixes spell 56745 too

@Shauren
Copy link
Member

Shauren commented Apr 18, 2024

Original code (before 4913d02) skipped the visual if it had a playercondition and caster wasnt a player

@Shauren Shauren merged commit 8d8a54d into TrinityCore:master Apr 20, 2024
3 of 6 checks passed
@mdX7 mdX7 deleted the spells/spellvisual branch April 20, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants