diff options
| author | click <none@none> | 2010-05-16 04:03:53 +0200 |
|---|---|---|
| committer | click <none@none> | 2010-05-16 04:03:53 +0200 |
| commit | 89887b9b6554656033079bd3c90e1495fb9edf74 (patch) | |
| tree | ab52fd1065913f0997353b630faf8c36f76b16f4 /src | |
| parent | 6ee54548f34ab2247612f2d24e7412ce798dd3af (diff) | |
Correct SMSG_INSTANCE_DIFFICULTY structure (fixes raid difficulty display).
Move GetDifficulty() in under Map-scope, so it's reachable for map-based functions
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Map.cpp | 2 | ||||
| -rw-r--r-- | src/game/Map.h | 9 | ||||
| -rw-r--r-- | src/game/Player.cpp | 4 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 0a669d9b828..dc2a8bc921b 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -2740,7 +2740,7 @@ void InstanceMap::SetResetSchedule(bool on) } } -MapDifficulty const* InstanceMap::GetMapDifficulty() const +MapDifficulty const* Map::GetMapDifficulty() const { return GetMapDifficultyData(GetId(),GetDifficulty()); } diff --git a/src/game/Map.h b/src/game/Map.h index 9e7fa49f066..a192390ba37 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -357,6 +357,11 @@ class Map : public GridRefManager<NGridType>, public Trinity::ObjectLevelLockabl virtual bool CanEnter(Player* /*player*/) { return true; } const char* GetMapName() const; + // have meaning only for instanced map (that have set real difficulty) + Difficulty GetDifficulty() const { return Difficulty(GetSpawnMode()); } + bool IsRegularDifficulty() const { return GetDifficulty() == REGULAR_DIFFICULTY; } + MapDifficulty const* GetMapDifficulty() const; + bool Instanceable() const { return i_mapEntry && i_mapEntry->Instanceable(); } // NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); } @@ -581,12 +586,8 @@ class InstanceMap : public Map void SendResetWarnings(uint32 timeLeft) const; void SetResetSchedule(bool on); - // have meaning only for instanced map (that have set real difficulty) - Difficulty GetDifficulty() const { return Difficulty(GetSpawnMode()); } - bool IsRegularDifficulty() const { return GetDifficulty() == REGULAR_DIFFICULTY; } uint32 GetMaxPlayers() const; uint32 GetMaxResetDelay() const; - MapDifficulty const* GetMapDifficulty() const; virtual void InitVisibilityDistance(); private: diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 4370953a7be..cea646fe436 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20713,6 +20713,10 @@ void Player::SendInitialPacketsBeforeAddToMap() SendTalentsInfoData(false); // SMSG_INSTANCE_DIFFICULTY + data.Initialize(SMSG_INSTANCE_DIFFICULTY, 4+4); + data << uint32(GetMap()->GetDifficulty()); + data << uint32(0); + GetSession()->SendPacket(&data); SendInitialSpells(); |
