[7440] Use server-side only zone info. Optimize related calles in case zone and subzone use.

This in some cases make some zones not explorable if it not have server side data in current maps
but not allow cheating with zone set from client.
This commit is contained in:
VladimirMangos 2009-03-11 08:48:52 +03:00
parent 071a0317f0
commit 329fb3f9d1
15 changed files with 103 additions and 56 deletions

View file

@ -1674,7 +1674,7 @@ float Map::GetWaterLevel(float x, float y ) const
return 0;
}
uint32 Map::GetAreaId(uint16 areaflag,uint32 map_id)
uint32 Map::GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id)
{
AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
@ -1684,7 +1684,7 @@ uint32 Map::GetAreaId(uint16 areaflag,uint32 map_id)
return 0;
}
uint32 Map::GetZoneId(uint16 areaflag,uint32 map_id)
uint32 Map::GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id)
{
AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
@ -1694,6 +1694,14 @@ uint32 Map::GetZoneId(uint16 areaflag,uint32 map_id)
return 0;
}
void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag,uint32 map_id)
{
AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
areaid = entry ? entry->ID : 0;
zoneid = entry ? (( entry->zone != 0 ) ? entry->zone : entry->ID) : 0;
}
bool Map::IsInWater(float x, float y, float pZ) const
{
// Check surface in x, y point for liquid
@ -2205,7 +2213,6 @@ bool InstanceMap::Add(Player *player)
// first player enters (no players yet)
SetResetSchedule(false);
player->SendInitWorldStates();
sLog.outDetail("MAP: Player '%s' entered the instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName());
// initialize unload state
m_unloadTimer = 0;