replication for client side projectiles (#87)

This commit is contained in:
extrawurst
2025-12-14 19:41:45 +01:00
committed by GitHub
parent e7ebff2029
commit d93b38d1c8
15 changed files with 1139 additions and 962 deletions

View File

@@ -6,6 +6,7 @@ use bevy::{
},
prelude::*,
};
use bevy_replicon::client::ClientSystems;
use shared::{
control::{
BackpackButtonPress, CashHealPressed, ClientInputs, ControllerSet, Inputs, LocalInputs,
@@ -28,12 +29,21 @@ pub fn plugin(app: &mut App) {
)
.chain()
.in_set(ControllerSet::CollectInputs)
.before(ClientSystems::Receive)
.run_if(
in_state(GameState::Playing)
.and(resource_exists_and_equals(CharacterInputEnabled::On)),
),
)
.add_systems(PreUpdate, overwrite_local_inputs);
);
// run this deliberately after local input processing ended
// TODO: can and should be ordered using a set to guarantee it gets send out ASAP but after local input processing
app.add_systems(
PreUpdate,
overwrite_local_inputs.after(ClientSystems::Receive).run_if(
in_state(GameState::Playing).and(resource_exists_and_equals(CharacterInputEnabled::On)),
),
);
app.add_systems(
Update,