sanity check to fix possible FPE

This commit is contained in:
CPunch 2020-09-28 15:31:01 -05:00
parent 884b844d65
commit 3f35d2e960

View File

@ -495,6 +495,9 @@ std::pair<int,int> MobManager::lerp(int x1, int y1, int x2, int y2, int speed) {
int distance = hypot(x1 - x2, y1 - y2);
if (distance > speed) {
if (speed == 0)
speed = 1;
int lerps = distance / speed;
// interpolate only the first point