mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Even more fixes.
This commit is contained in:
parent
fdc20af337
commit
2015f21fa8
4 changed files with 27 additions and 21 deletions
|
|
@ -6217,29 +6217,19 @@ void Player::UpdateArea(uint32 newArea)
|
|||
|
||||
void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
||||
{
|
||||
if(m_zoneUpdateId != newZone)
|
||||
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
|
||||
|
||||
m_zoneUpdateId = newZone;
|
||||
m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
|
||||
|
||||
// zone changed, so area changed as well, update it
|
||||
UpdateArea(newArea);
|
||||
|
||||
AreaTableEntry const* zone = GetAreaEntryByAreaID(newZone);
|
||||
if(!zone)
|
||||
return;
|
||||
|
||||
if (sWorld.getConfig(CONFIG_WEATHER))
|
||||
if(m_zoneUpdateId != newZone)
|
||||
{
|
||||
Weather *wth = sWorld.FindWeather(zone->ID);
|
||||
if(wth)
|
||||
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
|
||||
|
||||
if (sWorld.getConfig(CONFIG_WEATHER))
|
||||
{
|
||||
wth->SendWeatherUpdateToPlayer(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!sWorld.AddWeather(zone->ID))
|
||||
if(Weather *wth = sWorld.FindWeather(zone->ID))
|
||||
wth->SendWeatherUpdateToPlayer(this);
|
||||
else if(!sWorld.AddWeather(zone->ID))
|
||||
{
|
||||
// send fine weather packet to remove old zone's weather
|
||||
Weather::SendFineWeatherUpdateToPlayer(this);
|
||||
|
|
@ -6247,6 +6237,12 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
|||
}
|
||||
}
|
||||
|
||||
m_zoneUpdateId = newZone;
|
||||
m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
|
||||
|
||||
// zone changed, so area changed as well, update it
|
||||
UpdateArea(newArea);
|
||||
|
||||
// in PvP, any not controlled zone (except zone->team == 6, default case)
|
||||
// in PvE, only opposition team capital
|
||||
switch(zone->team)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue