mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[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:
parent
071a0317f0
commit
329fb3f9d1
15 changed files with 103 additions and 56 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue