refactor(Core/Packets): Rewrite MSG_RANDOM_ROLL to new packet class (#10590)

* refactor(Core/Packets): Rewrite MSG_RANDOM_ROLL

* cherry-pick commit (c0f516caee)

Co-Authored-By: ForesterDev <11771800+ForesterDev@users.noreply.github.com>
Co-Authored-By: DJScias <439655+DJScias@users.noreply.github.com>

* handle crash check in DoRandomRoll()

* Update MiscPackets.h

* Update Player.h

Co-authored-by: ForesterDev <11771800+ForesterDev@users.noreply.github.com>
Co-authored-by: DJScias <439655+DJScias@users.noreply.github.com>
This commit is contained in:
Kitzunu
2022-02-11 10:30:49 +01:00
committed by GitHub
parent 3307da02f6
commit ead906c58f
8 changed files with 79 additions and 28 deletions

View File

@@ -30,3 +30,19 @@ WorldPacket const* WorldPackets::Misc::Weather::Write()
return &_worldPacket;
}
void WorldPackets::Misc::RandomRollClient::Read()
{
_worldPacket >> Min;
_worldPacket >> Max;
}
WorldPacket const* WorldPackets::Misc::RandomRoll::Write()
{
_worldPacket << uint32(Min);
_worldPacket << uint32(Max);
_worldPacket << uint32(Result);
_worldPacket << Roller;
return &_worldPacket;
}