Even more fixes.

This commit is contained in:
tomrus88 2009-08-29 00:50:34 +04:00
parent fdc20af337
commit 2015f21fa8
4 changed files with 27 additions and 21 deletions

View file

@ -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)