diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index 286dc225bbd..825ce125d36 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -1593,14 +1593,7 @@ LightInfo Creature::getCreatureLight() const { } uint16_t Creature::getSpeed() const { - const auto speed = baseSpeed + varSpeed; - if (speed >= 0 && speed <= std::numeric_limits::max()) { - return speed; - } else if (speed < 0) { - return 0; - } else { - return std::numeric_limits::max(); - } + return std::clamp(baseSpeed + varSpeed, 0, static_cast(std::numeric_limits::max())); } void Creature::setSpeed(int32_t varSpeedDelta) {