diff options
-rw-r--r-- | src/client.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client.rs b/src/client.rs index 6fe86b6..a1aa250 100644 --- a/src/client.rs +++ b/src/client.rs @@ -105,7 +105,9 @@ impl Plugin for ClientPlugin { .add_systems(Update, move_camera) .add_systems( FixedPreUpdate, - buffer_input.in_set(InputSystemSet::BufferInputs), + buffer_input + .in_set(InputSystemSet::BufferInputs) + .before(choose_attack), ) .add_systems(Last, (gizmos_hover_indicator, gizmos_attack_indicator)); } @@ -345,6 +347,15 @@ fn buffer_input( } } } + } else if mouse_input.just_pressed(MouseButton::Right) { + match attack.0 { + None => { + if let Some(world_position) = cursor_world_position(&windows, &cameras) { + client.add_input(Inputs::Imperative(Imperative::WalkTo(world_position))); + } + } + Some(_) => {} + } } else if keyboard_input.just_pressed(KeyCode::KeyS) { client.add_input(Inputs::Imperative(Imperative::Idle)); } else { |