[Core] Clarify weather packet (c2649)

Also clamp weather density for .wchange command instead of just return an error

Thanks to @Laizerox for info and @cala for testing
This commit is contained in:
stfx 2015-03-26 13:24:25 +00:00 committed by Antz
parent 63343716b5
commit 4edda934a8
2 changed files with 6 additions and 5 deletions

View File

@ -4229,9 +4229,11 @@ bool ChatHandler::HandleChangeWeatherCommand(char* args)
if (!ExtractFloat(&args, grade))
{ return false; }
// 0 to 1, sending -1 is instand good weather
if (grade < 0.0f || grade > 1.0f)
{ return false; }
// clamp grade from 0 to 1
if (grade < 0.0f)
grade = 0.0f;
else if (grade > 1.0f)
grade = 1.0f;
Player* player = m_session->GetPlayer();
uint32 zoneId = player->GetZoneId();

View File

@ -342,8 +342,7 @@ class WorldSession
void SendPlaySpellVisual(ObjectGuid guid, uint32 spellArtKit);
void SendItemPageInfo(ItemPrototype* itemProto);
public: // opcodes handlers
// opcodes handlers
void Handle_NULL(WorldPacket& recvPacket); // not used
void Handle_EarlyProccess(WorldPacket& recvPacket); // just mark packets processed in WorldSocket::OnRead
void Handle_ServerSide(WorldPacket& recvPacket); // sever side only, can't be accepted from client