Skip to content

Commit

Permalink
Fix #74: update ottd_display_speed to match changes from OpenTTD r239…
Browse files Browse the repository at this point in the history
…45. (#75)

Co-authored-by: juzza1 <juzza1@gmail.com>
  • Loading branch information
planetmaker and juzza1 committed May 5, 2020
1 parent 5434ef4 commit 7affc55
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nml/actions/action0properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def cargo_list(value, max_num_cargos):
}

def ottd_display_speed(value, divisor, unit):
return int(value.value / divisor) * 10 // 16 * unit.ottd_mul >> unit.ottd_shift
return (round(value.value / divisor * 10 * unit.ottd_mul) >> unit.ottd_shift) // 16

class VariableListProp(BaseAction0Property):
"""
Expand Down
Binary file modified regression/expected/006_vehicle.grf
Binary file not shown.
2 changes: 1 addition & 1 deletion regression/expected/006_vehicle.nfo
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ FF
0A \dx00004C48
09 87
11 8F
08 98
08 96
13 16
14 58
0E FF
Expand Down
Binary file modified regression/expected/013_train_callback.grf
Binary file not shown.
2 changes: 1 addition & 1 deletion regression/expected/013_train_callback.nfo
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ FF
FF

64 * 22 00 00 \b5 01 FF \wx0074
09 \wx0025
09 \wx0024
09 \wx0000
09 \wx0000
09 \wx0000
Expand Down

0 comments on commit 7affc55

Please sign in to comment.