mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 06:06:23 +00:00
fix(Core/Packets): Fix a crash in MSG_RANDOM_ROLL. (#14545)
This commit is contained in:
@@ -16047,7 +16047,7 @@ void Player::RemoveRestFlag(RestFlag restFlag)
|
||||
|
||||
uint32 Player::DoRandomRoll(uint32 minimum, uint32 maximum)
|
||||
{
|
||||
ASSERT(minimum <= maximum || maximum <= 10000);
|
||||
ASSERT(minimum <= maximum);
|
||||
|
||||
uint32 roll = urand(minimum, maximum);
|
||||
|
||||
|
||||
@@ -567,6 +567,12 @@ void WorldSession::HandleRandomRollOpcode(WorldPackets::Misc::RandomRollClient&
|
||||
minimum = packet.Min;
|
||||
maximum = packet.Max;
|
||||
|
||||
/** error handling **/
|
||||
if (minimum > maximum || maximum > 10000) // < 32768 for urand call
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GetPlayer()->DoRandomRoll(minimum, maximum);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user