Core/Players: Fixed spell overrides not being removed when unlearning talents
This commit is contained in:
@@ -3293,6 +3293,7 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled /*= false*/, bool learn_
|
||||
|
||||
bool cur_active = itr->second.active;
|
||||
bool cur_dependent = itr->second.dependent;
|
||||
Optional<int32> traitDefinitionId = itr->second.TraitDefinitionId;
|
||||
|
||||
if (disabled)
|
||||
{
|
||||
@@ -3405,6 +3406,10 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled /*= false*/, bool learn_
|
||||
}
|
||||
}
|
||||
|
||||
if (traitDefinitionId)
|
||||
if (TraitDefinitionEntry const* traitDefinition = sTraitDefinitionStore.LookupEntry(*traitDefinitionId))
|
||||
RemoveOverrideSpell(traitDefinition->OverridesSpellID, spell_id);
|
||||
|
||||
m_overrideSpells.erase(spell_id);
|
||||
|
||||
if (m_canTitanGrip)
|
||||
|
||||
@@ -392,7 +392,7 @@ void FillOwnedCurrenciesMap(WorldPackets::Traits::TraitConfig const& traitConfig
|
||||
currencies[currency->ID] += player.GetCurrencyQuantity(currency->CurrencyTypesID);
|
||||
break;
|
||||
case TraitCurrencyType::TraitSourced:
|
||||
if (std::vector<TraitCurrencySourceEntry const*>* currencySources = Trinity::Containers::MapGetValuePtr(_traitCurrencySourcesByCurrency, currency->ID))
|
||||
if (std::vector<TraitCurrencySourceEntry const*> const* currencySources = Trinity::Containers::MapGetValuePtr(_traitCurrencySourcesByCurrency, currency->ID))
|
||||
{
|
||||
for (TraitCurrencySourceEntry const* currencySource : *currencySources)
|
||||
{
|
||||
@@ -667,7 +667,6 @@ LearnResult ValidateConfig(WorldPackets::Traits::TraitConfig const& traitConfig,
|
||||
int32* grantedCount = Trinity::Containers::MapGetValuePtr(grantedCurrencies, traitCurrencyId);
|
||||
if (!grantedCount || *grantedCount < spentAmount)
|
||||
return LearnResult::NotEnoughTalentsInPrimaryTree;
|
||||
|
||||
}
|
||||
|
||||
if (requireSpendingAllCurrencies && traitConfig.Type == TraitConfigType::Combat)
|
||||
|
||||
Reference in New Issue
Block a user