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 some enchantments checks and fixed serious logic flaw in createitem effect check #19123

Merged
merged 1 commit into from Mar 11, 2017

Conversation

ghost
Copy link

@ghost ghost commented Feb 12, 2017

Target branch(es): 3.3.5

  • 3.3.5

Tests performed: Compiles

As stated in title, any feedback is welcomed.

if (!IsTriggered() && m_spellInfo->Effects[i].ItemType)
// m_targets.GetUnitTarget() means explicit cast, otherwise we dont check for possible equip error
Unit* target = m_targets.GetUnitTarget() ? m_targets.GetUnitTarget() : m_caster;
if (target && target->GetTypeId() == TYPEID_PLAYER && !IsTriggered() && m_spellInfo->Effects[i].ItemType)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (target) is dead check, m_caster can never be NULL

Copy link
Author

@ghost ghost Feb 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be no ? : m_caster, at all. Left it in case something else could depend on this check somehow (and thus the target check in case someone decides to remove it completely).

@Shauren Shauren merged commit 8c80e2b into TrinityCore:3.3.5 Mar 11, 2017
Aokromes pushed a commit to Aokromes/TrinityCore that referenced this pull request Mar 13, 2017
Shauren pushed a commit that referenced this pull request Aug 17, 2019
…law in create item effect check (#19123)

(cherrypicked from 8c80e2b)
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.

2 participants