mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
[Bug Fix] Use std::clamp for Mob::ChangeSize (#4140)
Helper template was not deducing float for lower/upper values allowing invalid sizes Limit to sane values of 1-255 unrestricted and 3-15 for clients and pets
This commit is contained in:
parent
c3d8d423fe
commit
79c8858ec8
10
zone/mob.cpp
10
zone/mob.cpp
@ -4384,17 +4384,15 @@ void Mob::SendWearChangeAndLighting(int8 last_texture) {
|
|||||||
|
|
||||||
void Mob::ChangeSize(float in_size = 0, bool unrestricted)
|
void Mob::ChangeSize(float in_size = 0, bool unrestricted)
|
||||||
{
|
{
|
||||||
|
size = std::clamp(in_size, 1.0f, 255.0f);
|
||||||
|
|
||||||
if (!unrestricted) {
|
if (!unrestricted) {
|
||||||
if (IsClient() || petid != 0) {
|
if (IsClient() || petid != 0) {
|
||||||
EQ::Clamp(in_size, 3.0f, 15.0f);
|
size = std::clamp(in_size, 3.0f, 15.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQ::Clamp(in_size, 1.0f, 255.0f);
|
SendAppearancePacket(AppearanceType::Size, static_cast<uint32>(size));
|
||||||
|
|
||||||
size = in_size;
|
|
||||||
|
|
||||||
SendAppearancePacket(AppearanceType::Size, static_cast<uint32>(in_size));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Mob* Mob::GetOwnerOrSelf()
|
Mob* Mob::GetOwnerOrSelf()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user