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

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.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-11 16:17:37 -06:00
parent 5286f2351f
commit 6e29ab4fbb
15 changed files with 107 additions and 67 deletions

View File

@@ -1802,7 +1802,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);
@@ -1812,7 +1812,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);
@@ -1822,6 +1822,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
@@ -2308,7 +2316,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;