diff options
| author | joschiwald <joschiwald.trinity@gmail.com> | 2017-11-19 16:25:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-19 16:25:30 +0100 |
| commit | f9067f2aab4f872c2f7a8f58efd6d8ed74fedbf8 (patch) | |
| tree | 215c8b1705e21b5f0edfca9cead80674f1d6c035 /src/server/game/Entities | |
| parent | b12b37058c863bcfecfefc965da45f31b604ee3b (diff) | |
Core/Auras: don't save auras casted by items
* Core/Auras: don't save auras casted by items
- This type of auras (like Water Bucket, Precious Ribbon, etc) will be recasted on login anyways.
This reverts commit 16cfd59f5b368fd1d05eeeab3afbacfccf0a6870
(partial cherry picked from commit e84dfff4cee74baf2c02cc7752df5bf392eae180)
Core/Auras: fix elixir aura saving
(cherry picked from commit 697147a596515c82817a161e7a9a5f07cdf9a8f3)
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 11 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7c1c34ef59a..e21b5e06607 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18297,7 +18297,7 @@ void Player::_LoadAuras(PreparedQueryResult auraResult, PreparedQueryResult effe AuraLoadEffectInfo& info = effectInfo[key]; ObjectGuid castId = ObjectGuid::Create<HighGuid::Cast>(SPELL_CAST_SOURCE_NORMAL, GetMapId(), spellInfo->Id, GetMap()->GenerateLowGuid<HighGuid::Cast>()); - if (Aura* aura = Aura::TryCreate(spellInfo, castId, key.EffectMask, this, nullptr, info.BaseAmounts.data(), nullptr, casterGuid, castItemLevel)) + if (Aura* aura = Aura::TryCreate(spellInfo, castId, key.EffectMask, this, nullptr, info.BaseAmounts.data(), nullptr, casterGuid, itemGuid, castItemLevel)) { if (!aura->CanBeSaved()) { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 472f2e3818d..754dc02b4c4 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3089,7 +3089,7 @@ void Unit::DeMorph() SetDisplayId(GetNativeDisplayId()); } -Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint32 effMask, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/, bool resetPeriodicTimer /*= true*/, int32 castItemLevel /*= -1*/) +Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint32 effMask, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/, bool resetPeriodicTimer /*= true*/, ObjectGuid castItemGuid /*= ObjectGuid::Empty*/, int32 castItemLevel /*= -1*/) { ASSERT(!casterGUID.IsEmpty() || caster); @@ -3101,15 +3101,14 @@ Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint3 if (!newAura->IsMultiSlotAura()) { // check if cast item changed - ObjectGuid castItemGUID; if (castItem) { - castItemGUID = castItem->GetGUID(); + castItemGuid = castItem->GetGUID(); castItemLevel = castItem->GetItemLevel(castItem->GetOwner()); } // find current aura from spell and change it's stackamount, or refresh it's duration - if (Aura* foundAura = GetOwnedAura(newAura->Id, casterGUID, (newAura->HasAttribute(SPELL_ATTR0_CU_ENCHANT_PROC)) ? castItemGUID : ObjectGuid::Empty, 0)) + if (Aura* foundAura = GetOwnedAura(newAura->Id, casterGUID, (newAura->HasAttribute(SPELL_ATTR0_CU_ENCHANT_PROC)) ? castItemGuid : ObjectGuid::Empty, 0)) { // effect masks do not match // extremely rare case @@ -3138,10 +3137,10 @@ Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint3 } // correct cast item guid if needed - if (castItemGUID != foundAura->GetCastItemGUID()) + if (castItemGuid != foundAura->GetCastItemGUID()) { ObjectGuid* oldGUID = const_cast<ObjectGuid*>(&foundAura->m_castItemGuid); - *oldGUID = castItemGUID; + *oldGUID = castItemGuid; int32* oldItemLevel = const_cast<int32*>(&foundAura->m_castItemLevel); *oldItemLevel = castItemLevel; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 827107d55fc..3fd5d7a6da7 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1434,7 +1434,7 @@ class TC_GAME_API Unit : public WorldObject bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id); // aura apply/remove helpers - you should better not use these - Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint32 effMask, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, ObjectGuid casterGUID = ObjectGuid::Empty, bool resetPeriodicTimer = true, int32 castItemLevel = -1); + Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint32 effMask, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, ObjectGuid casterGUID = ObjectGuid::Empty, bool resetPeriodicTimer = true, ObjectGuid castItemGuid = ObjectGuid::Empty, int32 castItemLevel = -1); void _AddAura(UnitAura* aura, Unit* caster); AuraApplication * _CreateAuraApplication(Aura* aura, uint32 effMask); void _ApplyAuraEffect(Aura* aura, uint8 effIndex); |
