ssb: Idea: ebt clocks shouldn't go backward.

This commit is contained in:
Cory McWilliams 2025-03-17 20:49:55 -04:00
parent 9899c0c5e2
commit d7e9fd918a

View File

@ -137,13 +137,13 @@ void tf_ssb_ebt_receive_clock(tf_ssb_ebt_t* ebt, JSContext* context, JSValue clo
{ {
if (sequence < 0) if (sequence < 0)
{ {
entry->in = -1; entry->in = tf_max(entry->in, -1);
entry->in_replicate = false; entry->in_replicate = false;
entry->in_receive = false; entry->in_receive = false;
} }
else else
{ {
entry->in = sequence >> 1; entry->in = tf_max(entry->in, sequence >> 1);
entry->in_replicate = true; entry->in_replicate = true;
entry->in_receive = (sequence & 1) == 0; entry->in_receive = (sequence & 1) == 0;
} }