Skip to content

Commit 4539e43

Browse files
committed
Merge branch 'master' of github.com:donadigo/TMInterfaceClientPython
2 parents 1f2d274 + 6269dc8 commit 4539e43

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tminterface/interface.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,17 @@ def rewind_to_state(self, state: SimStateData):
502502

503503
self.__write_checkpoint_state(msg, state.cp_data)
504504
self._send_message(msg)
505+
506+
# Send client the number of CPs of the state rewinded to
507+
cp_count = len([time for (time, _) in state.cp_data.cp_times if time != -1])
508+
cp_target = len(state.cp_data.cp_times)
509+
self.client.on_checkpoint_count_changed(self, cp_count, cp_target)
510+
511+
# Send client the number of laps of the state rewinded to
512+
if (len(state.cp_data.cp_states) > 0):
513+
lap_count = cp_count // len(state.cp_data.cp_states)
514+
self.client.on_laps_count_changed(self, lap_count)
515+
505516
self._wait_for_server_response()
506517

507518
def set_checkpoint_state(self, data: CheckpointData):

0 commit comments

Comments
 (0)