diff --git a/src/services/game/location.ts b/src/services/game/location.ts index b601ded..f0881cc 100644 --- a/src/services/game/location.ts +++ b/src/services/game/location.ts @@ -66,7 +66,15 @@ const getTravelTimeInHours = ( ) => { const distance = getLocationDistance(locationA, locationB); - return (distance / getSpeed(player)) * 3600000; + return distance / getSpeed(player); +}; + +const getTravelTimeInMilliseconds = ( + player: IPlayer, + locationA: ILocation, + locationB: ILocation, +) => { + return getTravelTimeInHours(player, locationA, locationB) * 3600000; }; const startTravel = ( @@ -82,7 +90,7 @@ const startTravel = ( () => { finishTravel(player, newLocation, client, roomId); }, - getTravelTimeInHours(player, currentLocation, newLocation), + getTravelTimeInMilliseconds(player, currentLocation, newLocation), ); }; @@ -108,6 +116,7 @@ export { getParentLocation, hasLocation, getTravelTimeInHours, + getTravelTimeInMilliseconds, startTravel, finishTravel, };