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
This commit is contained in:
click
2010-05-16 04:03:53 +02:00
parent 6ee54548f3
commit 89887b9b65
3 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -2740,7 +2740,7 @@ void InstanceMap::SetResetSchedule(bool on)
} }
} }
MapDifficulty const* InstanceMap::GetMapDifficulty() const MapDifficulty const* Map::GetMapDifficulty() const
{ {
return GetMapDifficultyData(GetId(),GetDifficulty()); return GetMapDifficultyData(GetId(),GetDifficulty());
} }
+5 -4
View File
@@ -357,6 +357,11 @@ class Map : public GridRefManager<NGridType>, public Trinity::ObjectLevelLockabl
virtual bool CanEnter(Player* /*player*/) { return true; } virtual bool CanEnter(Player* /*player*/) { return true; }
const char* GetMapName() const; 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(); } 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 // 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(); } bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); }
@@ -581,12 +586,8 @@ class InstanceMap : public Map
void SendResetWarnings(uint32 timeLeft) const; void SendResetWarnings(uint32 timeLeft) const;
void SetResetSchedule(bool on); 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 GetMaxPlayers() const;
uint32 GetMaxResetDelay() const; uint32 GetMaxResetDelay() const;
MapDifficulty const* GetMapDifficulty() const;
virtual void InitVisibilityDistance(); virtual void InitVisibilityDistance();
private: private:
+4
View File
@@ -20713,6 +20713,10 @@ void Player::SendInitialPacketsBeforeAddToMap()
SendTalentsInfoData(false); SendTalentsInfoData(false);
// SMSG_INSTANCE_DIFFICULTY // SMSG_INSTANCE_DIFFICULTY
data.Initialize(SMSG_INSTANCE_DIFFICULTY, 4+4);
data << uint32(GetMap()->GetDifficulty());
data << uint32(0);
GetSession()->SendPacket(&data);
SendInitialSpells(); SendInitialSpells();