replication for client side projectiles (#87)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user