aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.cpp1
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp28
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h4
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp5
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h2
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.h13
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp1
7 files changed, 19 insertions, 35 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 404d3801e4f..b382735d3ef 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -920,7 +920,6 @@ void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool
// if arena, remove the specific arena auras
if (isArena())
{
- plr->RemoveArenaAuras(true); // removes debuffs / dots etc., we don't want the player to die after porting out
bgTypeId=BATTLEGROUND_AA; // set the bg type to all arenas (it will be used for queue refreshing)
// unsummon current and summon old pet if there was one and there isn't a current pet
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index b749126e2e2..af1ffc96188 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -14277,15 +14277,12 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
ModifyMoney(-cost);
}
-uint32 Player::GetGossipTextId(WorldObject *pSource)
+uint32 Player::GetGossipTextId(WorldObject* source)
{
- if (!pSource || pSource->GetTypeId() != TYPEID_UNIT || !pSource->ToCreature()->GetDBTableGUIDLow())
+ if (!source)
return DEFAULT_GOSSIP_MESSAGE;
- if (uint32 pos = sObjectMgr->GetNpcGossip(pSource->ToCreature()->GetDBTableGUIDLow()))
- return pos;
-
- return DEFAULT_GOSSIP_MESSAGE;
+ return GetGossipTextId(GetDefaultGossipMenuForSource(source));
}
uint32 Player::GetGossipTextId(uint32 menuId)
@@ -14295,23 +14292,24 @@ uint32 Player::GetGossipTextId(uint32 menuId)
if (!menuId)
return textId;
- GossipMenusMapBounds pMenuBounds = sObjectMgr->GetGossipMenusMapBounds(menuId);
+ GossipMenusMapBounds menuBounds = sObjectMgr->GetGossipMenusMapBounds(menuId);
- for (GossipMenusMap::const_iterator itr = pMenuBounds.first; itr != pMenuBounds.second; ++itr)
- {
+ for (GossipMenusMap::const_iterator itr = menuBounds.first; itr != menuBounds.second; ++itr)
if (sConditionMgr->IsPlayerMeetToConditions(this, itr->second.conditions))
textId = itr->second.text_id;
- }
return textId;
}
-uint32 Player::GetDefaultGossipMenuForSource(WorldObject *pSource)
+uint32 Player::GetDefaultGossipMenuForSource(WorldObject* source)
{
- if (pSource->GetTypeId() == TYPEID_UNIT)
- return pSource->ToCreature()->GetCreatureInfo()->GossipMenuId;
- else if (pSource->GetTypeId() == TYPEID_GAMEOBJECT)
- return((GameObject*)pSource)->GetGOInfo()->GetGossipMenuId();
+ switch (source->GetTypeId())
+ {
+ case TYPEID_UNIT:
+ return source->ToCreature()->GetCreatureInfo()->GossipMenuId;
+ case TYPEID_GAMEOBJECT:
+ return source->ToGameObject()->GetGOInfo()->GetGossipMenuId();
+ }
return 0;
}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index e2367b2d864..6055b9f797d 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1339,8 +1339,8 @@ class Player : public Unit, public GridObject<Player>
void OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 menuId);
uint32 GetGossipTextId(uint32 menuId);
- uint32 GetGossipTextId(WorldObject *pSource);
- uint32 GetDefaultGossipMenuForSource(WorldObject *pSource);
+ uint32 GetGossipTextId(WorldObject* source);
+ static uint32 GetDefaultGossipMenuForSource(WorldObject* source);
/*********************************************************/
/*** QUEST SYSTEM ***/
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index ab38a5301f1..9657622a3a9 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -4029,7 +4029,7 @@ void Unit::RemoveAllAuras()
}
}
-void Unit::RemoveArenaAuras(bool onleave)
+void Unit::RemoveArenaAuras()
{
// in join, remove positive buffs, on end, remove negative
// used to remove positive visible auras in arenas
@@ -4039,8 +4039,7 @@ void Unit::RemoveArenaAuras(bool onleave)
Aura const* aura = aurApp->GetBase();
if (!(aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR4_UNK21) // don't remove stances, shadowform, pally/hunter auras
&& !aura->IsPassive() // don't remove passive auras
- && !(aura->GetSpellProto()->AttributesEx3 & SPELL_ATTR3_DEATH_PERSISTENT) // not death persistent auras
- && (aurApp->IsPositive() ^ onleave)) // remove positive buffs on enter, negative buffs on leave
+ && (aurApp->IsPositive() || !(aura->GetSpellProto()->AttributesEx3 & SPELL_ATTR3_DEATH_PERSISTENT))) // not negative death persistent auras
RemoveAura(iter);
else
++iter;
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 12884f76951..ed2b21bf6db 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1663,7 +1663,7 @@ class Unit : public WorldObject
void RemoveAreaAurasDueToLeaveWorld();
void RemoveAllAuras();
- void RemoveArenaAuras(bool onleave = false);
+ void RemoveArenaAuras();
void RemoveAllAurasOnDeath();
void RemoveAllAurasRequiringDeadTarget();
void RemoveAllAurasExceptType(AuraType type);
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index c7f51c5b784..ab1c7f1cfe4 100755
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -538,9 +538,6 @@ struct GraveYardData
};
typedef std::multimap<uint32, GraveYardData> GraveYardMap;
-// NPC gossip text id
-typedef UNORDERED_MAP<uint32, uint32> CacheNpcTextIdMap;
-
typedef UNORDERED_MAP<uint32, VendorItemData> CacheVendorItemMap;
typedef UNORDERED_MAP<uint32, TrainerSpellData> CacheTrainerSpellMap;
@@ -1148,15 +1145,6 @@ class ObjectMgr
bool AddGameTele(GameTele& data);
bool DeleteGameTele(const std::string& name);
- uint32 GetNpcGossip(uint32 entry) const
- {
- CacheNpcTextIdMap::const_iterator iter = m_mCacheNpcTextIdMap.find(entry);
- if (iter == m_mCacheNpcTextIdMap.end())
- return 0;
-
- return iter->second;
- }
-
TrainerSpellData const* GetNpcTrainerSpells(uint32 entry) const
{
CacheTrainerSpellMap::const_iterator iter = m_mCacheTrainerSpellMap.find(entry);
@@ -1369,7 +1357,6 @@ class ObjectMgr
RespawnTimes mGORespawnTimes;
ACE_Thread_Mutex m_GORespawnTimesMtx;
- CacheNpcTextIdMap m_mCacheNpcTextIdMap;
CacheVendorItemMap m_mCacheVendorItemMap;
CacheTrainerSpellMap m_mCacheTrainerSpellMap;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 87c5c584f4d..656e5ac9ab5 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -740,6 +740,7 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
case TARGET_UNIT_AREA_ENEMY_SRC:
case TARGET_UNIT_AREA_ENEMY_DST:
case TARGET_UNIT_CONE_ENEMY:
+ case TARGET_UNIT_AREA_PATH:
case TARGET_DEST_DYNOBJ_ENEMY:
case TARGET_DST_TARGET_ENEMY:
return false;