]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/MapState.cpp
fixed divide by zero bug in MapState
[l2e.git] / src / map / MapState.cpp
index 51e99869f618588b2bb09b3b76dfdde1b9cbc687..baefdc5ef59c91e5095bc0999dcd14e95125549f 100644 (file)
@@ -139,7 +139,9 @@ void MapState::OnTileLock() {
                                StopFollowers(*controlled);
                                if (!moveTimer.Running()) {
                                        int tileSize((controlled->GetOrientation() % 2) ? map->Tileset()->Width() : map->Tileset()->Height());
-                                       moveTimer = PhysicsTimers().StartInterval(tileSize/walkingSpeed.Int());
+                                       Fixed<8> walkingInterval(tileSize);
+                                       walkingInterval /= walkingSpeed;
+                                       moveTimer = PhysicsTimers().StartInterval(walkingInterval.Int());
                                }
                                pushed = 0;
                        }