Skip to content

Commit 7fc1da2

Browse files
authored
Fix 04b02a6: ticks_playing is game_date - start_date, not the other way around (#30)
1 parent 04b02a6 commit 7fc1da2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openttd_protocol/protocol/coordinator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def receive_PACKET_COORDINATOR_SERVER_UPDATE(source, data):
220220

221221
# Estimate, where possible, for older versions.
222222
if game_info_version < 7:
223-
ticks_playing = max(0, (start_date - game_date) * 74)
223+
ticks_playing = max(0, (game_date - start_date) * 74)
224224

225225
if len(data) != 0:
226226
raise PacketInvalidData("more bytes than expected in SERVER_UPDATE; remaining: ", len(data))

openttd_protocol/protocol/game.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def receive_PACKET_SERVER_GAME_INFO(source, data):
139139

140140
# Estimate, where possible, for older versions.
141141
if game_info_version < 7:
142-
ticks_playing = max(0, (start_date - game_date) * 74)
142+
ticks_playing = max(0, (game_date - start_date) * 74)
143143

144144
if len(data) != 0:
145145
raise PacketInvalidData("more bytes than expected in SERVER_GAME_INFO; remaining: ", len(data))

0 commit comments

Comments
 (0)