Core/Spells: fixed more warnings and deprecations

This commit is contained in:
Ovahlord committed 2023-07-07 23:10:54 +02:00
1 parent aaff7e2ced
commit c231bf34e5
2 files changed
+5 -9

No files matched your search

@@ -3865,7 +3865,7 @@ void AuraEffect::HandleAuraModIncreaseEnergy(AuraApplication const* aurApp, uint
Unit* target = aurApp->GetTarget();
Powers powerType = Powers(GetMiscValue());
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + AsUnderlyingType(powerType));
target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
}
@@ -3878,7 +3878,7 @@ void AuraEffect::HandleAuraModIncreaseEnergyPercent(AuraApplication const* aurAp
Unit* target = aurApp->GetTarget();
Powers powerType = Powers(GetMiscValue());
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + AsUnderlyingType(powerType));
// Save old powers for further calculation
int32 oldPower = int32(target->GetPower(powerType));
+3 -7
View File
@@ -5185,18 +5185,14 @@ void Spell::TakePower()
}
Powers powerType = Powers(m_spellInfo->PowerType);
bool hit = true;
if (unitCaster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->HasAttribute(SPELL_ATTR1_DISCOUNT_POWER_ON_MISS))
{
if (ObjectGuid targetGUID = m_targets.GetUnitTargetGUID())
ObjectGuid targetGUID = m_targets.GetUnitTargetGUID();
if (!targetGUID.IsEmpty())
{
auto ihit = std::find_if(std::begin(m_UniqueTargetInfo), std::end(m_UniqueTargetInfo), [&](TargetInfo const& targetInfo)
{
return targetInfo.TargetGUID == targetGUID && targetInfo.MissCondition != SPELL_MISS_NONE;
});
auto ihit = std::find_if(std::begin(m_UniqueTargetInfo), std::end(m_UniqueTargetInfo), [&](TargetInfo const& targetInfo) { return targetInfo.TargetGUID == targetGUID && targetInfo.MissCondition != SPELL_MISS_NONE; });
if (ihit != std::end(m_UniqueTargetInfo))
{
hit = false;
//lower spell cost on fail (by talent aura)
if (Player* modOwner = unitCaster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SpellModOp::PowerCostOnMiss, m_powerCost);