Skip to content

Commit

Permalink
refactor: added pragmas to travelInfo procedure
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 6216da3ddea172db66a1a1e30f364d664c8590e4939d85aecbf8d4d5dd4baca4
  • Loading branch information
thindil committed Jan 17, 2024
1 parent 87a28b1 commit 0ca2754
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nim/src/ui/utilsui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,15 @@ proc addCommands*() {.sideEffect, raises: [AddingCommandError], tags: [].} =
addCommand("ValidateAmount", validateAmountCommand)
addCommand("NimSetTextVariable", setTextVariableCommand)

proc travelInfo*(distance: Positive): array[1 .. 2, Natural] =
proc travelInfo*(distance: Positive): array[1 .. 2, Natural] {.sideEffect,
raises: [], tags: [].} =
result = [0, 0]
let speed = realSpeed(ship = playerShip, infoOnly = true) / 1_000
let speed = try:
realSpeed(ship = playerShip, infoOnly = true) / 1_000
except:
tclEval(script = "bgerror {Can't count the player's ship speed. Reason: " &
getCurrentExceptionMsg() & "}")
return
if speed == 0.0:
return
var minutesDiff: int = (100.0 / speed).int
Expand Down

0 comments on commit 0ca2754

Please sign in to comment.