File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -273,12 +273,16 @@ function hook_hand_rearrange()
273273 arguments = { cards = cards },
274274 }
275275
276- -- NOTE: we cannot schedule a log write because we don't have access to the
277- -- state before the function call. We need to recreate it.
278-
279- -- HACK: we cannot compute the timestamp before in the right way the function
280- -- call because because this hook run with the game loop. So we use the
281- -- timestamp for after and before
276+ -- NOTE: We cannot schedule a log write at this point because we do not have
277+ -- access to the game state before the function call. The game state is only
278+ -- available after the function executes, so we need to recreate the "before"
279+ -- state manually by using the most recent known state (LOG.game_state_before).
280+
281+ -- HACK: The timestamp for the log entry is problematic because this hook runs
282+ -- within the game loop, and we cannot accurately compute the "before" timestamp
283+ -- at the time of the function call. To address this, we use the same timestamp
284+ -- for both "before" and "after" states. This approach ensures that the log entry
285+ -- is consistent, but it may slightly reduce the accuracy of the timing information.
282286
283287 local timestamp_ms = math.floor (socket .gettime () * 1000 )
284288
You can’t perform that action at this time.
0 commit comments