diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-03-18 02:40:12 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-03-18 02:40:12 +0100 |
commit | e40eab9143fd881add48aba1e4ea1e1283c72cff (patch) | |
tree | 135b0844edab26258077c633fc008483f8a75b1b | |
parent | 312aa627052c24e0aa1948e584c046bc15f18c96 (diff) |
chore: run server systems in `fixed update`
-rw-r--r-- | src/server.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server.rs b/src/server.rs index 7d50d9f..6a22755 100644 --- a/src/server.rs +++ b/src/server.rs @@ -51,10 +51,10 @@ impl Plugin for ServerPlugin { .add_systems(Startup, setup) .add_systems(Update, (connects, disconnects)) .add_systems(Update, receive_message) - .add_systems(Update, timers_ticket) - .add_systems(Update, health_regen.after(timers_ticket)) + .add_systems(FixedUpdate, timers_tick) + .add_systems(FixedUpdate, health_regen.after(timers_tick)) .add_systems( - Update, + FixedUpdate, ( (imperative_attack_approach, imperative_attack_attack) .chain() @@ -64,14 +64,14 @@ impl Plugin for ServerPlugin { .after(player_input), ) .add_systems( - Update, + FixedUpdate, ( projectile_move.after(imperative_walk_to), projectile_despawn, ) .chain(), ) - .add_systems(Update, cooldown_decrement) + .add_systems(FixedUpdate, cooldown_decrement) .add_systems(FixedUpdate, player_input); } } @@ -444,7 +444,7 @@ fn cooldown_decrement(mut cooldowns: Query<&mut Cooldown>, time: Res<Time>) { } } -fn timers_ticket(mut health_regen_timer: ResMut<HealthRegenTimer>, time: Res<Time>) { +fn timers_tick(mut health_regen_timer: ResMut<HealthRegenTimer>, time: Res<Time>) { health_regen_timer.0.tick(time.delta()); } |