aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/Entities/Object/Object.cpp1
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp18
-rw-r--r--src/server/game/Globals/ObjectMgr.h18
-rw-r--r--src/server/game/Spells/SpellInfo.cpp1
4 files changed, 29 insertions, 9 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 4fc84906df8..7e7aacd942a 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -76,6 +76,7 @@ Object::Object() : m_PackGUID(sizeof(uint64)+1)
{
m_objectTypeId = TYPEID_OBJECT;
m_objectType = TYPEMASK_OBJECT;
+ m_updateFlag = UPDATEFLAG_NONE;
m_uint32Values = NULL;
m_valuesCount = 0;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index f16ab30567f..bbbecd1d474 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -7355,13 +7355,13 @@ void ObjectMgr::LoadNPCSpellClickSpells()
SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellinfo)
{
- TC_LOG_ERROR("sql.sql", "Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid);
+ TC_LOG_ERROR("sql.sql", "Table npc_spellclick_spells creature: %u references unknown spellid %u. Skipping entry.", npc_entry, spellid);
continue;
}
uint8 userType = fields[3].GetUInt16();
if (userType >= SPELL_CLICK_USER_MAX)
- TC_LOG_ERROR("sql.sql", "Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType));
+ TC_LOG_ERROR("sql.sql", "Table npc_spellclick_spells creature: %u references unknown user type %u. Skipping entry.", npc_entry, uint32(userType));
uint8 castFlags = fields[2].GetUInt8();
SpellClickInfo info;
@@ -7423,7 +7423,7 @@ void ObjectMgr::DeleteCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_
cell_guids.corpses.erase(player_guid);
}
-void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string const& table, bool starter, bool go)
+void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, QuestRelationsReverse* reverseMap, std::string const& table, bool starter, bool go)
{
uint32 oldMSTime = getMSTime();
@@ -7456,7 +7456,11 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string const&
}
if (!poolId || !starter)
+ {
map.insert(QuestRelations::value_type(id, quest));
+ if (reverseMap)
+ reverseMap->insert(QuestRelationsReverse::value_type(quest, id));
+ }
else if (starter)
poolRelationMap->insert(PooledQuestRelation::value_type(quest, id));
@@ -7468,7 +7472,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string const&
void ObjectMgr::LoadGameobjectQuestStarters()
{
- LoadQuestRelationsHelper(_goQuestRelations, "gameobject_queststarter", true, true);
+ LoadQuestRelationsHelper(_goQuestRelations, nullptr, "gameobject_queststarter", true, true);
for (QuestRelations::iterator itr = _goQuestRelations.begin(); itr != _goQuestRelations.end(); ++itr)
{
@@ -7482,7 +7486,7 @@ void ObjectMgr::LoadGameobjectQuestStarters()
void ObjectMgr::LoadGameobjectQuestEnders()
{
- LoadQuestRelationsHelper(_goQuestInvolvedRelations, "gameobject_questender", false, true);
+ LoadQuestRelationsHelper(_goQuestInvolvedRelations, &_goQuestInvolvedRelationsReverse, "gameobject_questender", false, true);
for (QuestRelations::iterator itr = _goQuestInvolvedRelations.begin(); itr != _goQuestInvolvedRelations.end(); ++itr)
{
@@ -7496,7 +7500,7 @@ void ObjectMgr::LoadGameobjectQuestEnders()
void ObjectMgr::LoadCreatureQuestStarters()
{
- LoadQuestRelationsHelper(_creatureQuestRelations, "creature_queststarter", true, false);
+ LoadQuestRelationsHelper(_creatureQuestRelations, nullptr, "creature_queststarter", true, false);
for (QuestRelations::iterator itr = _creatureQuestRelations.begin(); itr != _creatureQuestRelations.end(); ++itr)
{
@@ -7510,7 +7514,7 @@ void ObjectMgr::LoadCreatureQuestStarters()
void ObjectMgr::LoadCreatureQuestEnders()
{
- LoadQuestRelationsHelper(_creatureQuestInvolvedRelations, "creature_questender", false, false);
+ LoadQuestRelationsHelper(_creatureQuestInvolvedRelations, &_creatureQuestInvolvedRelationsReverse, "creature_questender", false, false);
for (QuestRelations::iterator itr = _creatureQuestInvolvedRelations.begin(); itr != _creatureQuestInvolvedRelations.end(); ++itr)
{
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index f9f5269e485..89f1f8f204c 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -518,8 +518,10 @@ typedef std::unordered_map<int32, TrinityStringLocale> TrinityStringLocaleContai
typedef std::unordered_map<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleContainer;
typedef std::unordered_map<uint32, PointOfInterestLocale> PointOfInterestLocaleContainer;
-typedef std::multimap<uint32, uint32> QuestRelations;
+typedef std::multimap<uint32, uint32> QuestRelations; // unit/go -> quest
+typedef std::multimap<uint32, uint32> QuestRelationsReverse; // quest -> unit/go
typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator> QuestRelationBounds;
+typedef std::pair<QuestRelationsReverse::const_iterator, QuestRelationsReverse::const_iterator> QuestRelationReverseBounds;
struct PetLevelInfo
{
@@ -952,6 +954,11 @@ class ObjectMgr
return _goQuestInvolvedRelations.equal_range(go_entry);
}
+ QuestRelationReverseBounds GetGOQuestInvolvedRelationReverseBounds(uint32 questId)
+ {
+ return _goQuestInvolvedRelationsReverse.equal_range(questId);
+ }
+
QuestRelations* GetCreatureQuestRelationMap()
{
return &_creatureQuestRelations;
@@ -967,6 +974,11 @@ class ObjectMgr
return _creatureQuestInvolvedRelations.equal_range(creature_entry);
}
+ QuestRelationReverseBounds GetCreatureQuestInvolvedRelationReverseBounds(uint32 questId)
+ {
+ return _creatureQuestInvolvedRelationsReverse.equal_range(questId);
+ }
+
void LoadEventScripts();
void LoadSpellScripts();
void LoadWaypointScripts();
@@ -1397,8 +1409,10 @@ class ObjectMgr
QuestRelations _goQuestRelations;
QuestRelations _goQuestInvolvedRelations;
+ QuestRelationsReverse _goQuestInvolvedRelationsReverse;
QuestRelations _creatureQuestRelations;
QuestRelations _creatureQuestInvolvedRelations;
+ QuestRelationsReverse _creatureQuestInvolvedRelationsReverse;
//character reserved names
typedef std::set<std::wstring> ReservedNamesContainer;
@@ -1426,7 +1440,7 @@ class ObjectMgr
private:
void LoadScripts(ScriptsType type);
void CheckScripts(ScriptsType type, std::set<int32>& ids);
- void LoadQuestRelationsHelper(QuestRelations& map, std::string const& table, bool starter, bool go);
+ void LoadQuestRelationsHelper(QuestRelations& map, QuestRelationsReverse* reverseMap, std::string const& table, bool starter, bool go);
void PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count);
MailLevelRewardContainer _mailLevelRewardStore;
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 4b6e4dc2ee7..49e84d26d60 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1016,6 +1016,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
Totem[i] = _totem ? _totem->Totem[i] : 0;
ChainEntry = NULL;
+ ExplicitTargetMask = 0;
}
SpellInfo::~SpellInfo()