Core/Logs: Added functions GetMapAreaAndZoneString() and GetCoordsMapAreaAndZoneString().
This commit is contained in:
1 parent
54749e6918
commit
170e93e83b
2 files changed
+28
No files matched your search
@@ -26206,6 +26206,31 @@ float Player::GetCollisionHeight(bool mounted) const
|
||||
}
|
||||
}
|
||||
|
||||
std::string Player::GetMapAreaAndZoneString()
|
||||
{
|
||||
uint32 areaId = GetAreaId();
|
||||
std::string areaName = "Unknown";
|
||||
std::string zoneName = "Unknown";
|
||||
if (AreaTableEntry const* area = GetAreaEntryByAreaID(areaId))
|
||||
{
|
||||
int locale = GetSession()->GetSessionDbcLocale();
|
||||
areaName = area->area_name[locale];
|
||||
if (AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone))
|
||||
zoneName = zone->area_name[locale];
|
||||
}
|
||||
|
||||
std::ostringstream str;
|
||||
str << "Map: " << GetMapId() << " (" << (FindMap() ? FindMap()->GetMapName() : "Unknown") << ") Area: " << areaId << " (" << areaName.c_str() << ") Zone: " << zoneName.c_str();
|
||||
return str.str();
|
||||
}
|
||||
|
||||
std::string Player::GetCoordsMapAreaAndZoneString()
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << Position::ToString() << " " << GetMapAreaAndZoneString();
|
||||
return str.str();
|
||||
}
|
||||
|
||||
Guild* Player::GetGuild()
|
||||
{
|
||||
uint32 guildId = GetGuildId();
|
||||
|
||||
@@ -2287,6 +2287,9 @@ class Player : public Unit, public GridObject<Player>
|
||||
//! Return collision height sent to client
|
||||
float GetCollisionHeight(bool mounted) const;
|
||||
|
||||
std::string GetMapAreaAndZoneString();
|
||||
std::string GetCoordsMapAreaAndZoneString();
|
||||
|
||||
protected:
|
||||
// Gamemaster whisper whitelist
|
||||
WhisperListContainer WhisperList;
|
||||
|
||||
Reference in new issue
Block a user