Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions addons/netfox/rewindable-action.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class_name RewindableAction

## Represents actions that may or may not happen, in a way compatible with
## rollback.
##
##
## @experimental: This class is experimental!
## @tutorial(RewindableAction Guide): https://foxssake.github.io/netfox/latest/netfox/nodes/rewindable-action/

Expand Down Expand Up @@ -167,7 +167,7 @@ func _before_rollback_loop() -> void:

# Queue mutations
for mutated in _mutated_objects:
NetworkRollback.mutate(mutated, earliest_change)
NetworkRollback.mutate(mutated, max(earliest_change, NetworkRollback.tick))

# Apply queue
for tick in _queued_changes:
Expand Down Expand Up @@ -199,7 +199,7 @@ func _after_loop() -> void:
if not _active_ticks.is_empty():
var earliest_active = _active_ticks.min()
for mutated in _mutated_objects:
NetworkRollback.mutate(mutated, earliest_active)
NetworkRollback.mutate(mutated, max(earliest_active, NetworkRollback.tick))

# Submit
if is_multiplayer_authority() and _last_set_tick >= 0:
Expand Down