Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
phacUFPE committed Nov 5, 2024
1 parent bbdc0f6 commit 75b0b33
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/creatures/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint16_t>::max()) {
return speed;
} else if (speed < 0) {
return 0;
} else {
return std::numeric_limits<uint16_t>::max();
}
return std::clamp(baseSpeed + varSpeed, 0, static_cast<int>(std::numeric_limits<uint16_t>::max()));
}

void Creature::setSpeed(int32_t varSpeedDelta) {
Expand Down

0 comments on commit 75b0b33

Please sign in to comment.