mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Entities/Unit/Unit.cpp src/server/game/Entities/Unit/Unit.h
This commit is contained in:
@@ -195,7 +195,6 @@ bool Weather::ReGenerate()
|
||||
void Weather::SendWeatherUpdateToPlayer(Player* player)
|
||||
{
|
||||
WorldPacket data(SMSG_WEATHER, (4+4+4));
|
||||
|
||||
data << uint32(GetWeatherState()) << (float)m_grade << uint8(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
@@ -203,10 +202,6 @@ void Weather::SendWeatherUpdateToPlayer(Player* player)
|
||||
/// Send the new weather to all players in the zone
|
||||
bool Weather::UpdateWeather()
|
||||
{
|
||||
Player* player = sWorld->FindPlayerInZone(m_zone);
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
///- Send the weather packet to all players in this zone
|
||||
if (m_grade >= 1)
|
||||
m_grade = 0.9999f;
|
||||
@@ -216,8 +211,13 @@ bool Weather::UpdateWeather()
|
||||
WeatherState state = GetWeatherState();
|
||||
|
||||
WorldPacket data(SMSG_WEATHER, (4+4+4));
|
||||
data << uint32(state) << (float)m_grade << uint8(0);
|
||||
player->SendMessageToSet(&data, true);
|
||||
data << uint32(state);
|
||||
data << (float)m_grade;
|
||||
data << uint8(0);
|
||||
|
||||
//- Returns false if there were no players found to update
|
||||
if (!sWorld->SendZoneMessage(m_zone, &data))
|
||||
return false;
|
||||
|
||||
///- Log the event
|
||||
char const* wthstr;
|
||||
@@ -264,8 +264,8 @@ bool Weather::UpdateWeather()
|
||||
wthstr = "fine";
|
||||
break;
|
||||
}
|
||||
TC_LOG_INFO("misc", "Change the weather of zone %u to %s.", m_zone, wthstr);
|
||||
|
||||
TC_LOG_INFO("misc", "Change the weather of zone %u to %s.", m_zone, wthstr);
|
||||
sScriptMgr->OnWeatherChange(this, state, m_grade);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user