Skip to content

Commit 7fd42e9

Browse files
Cleanup feature flags
1 parent a3c31ac commit 7fd42e9

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ name = "server"
4242
path = "src/server/main.rs"
4343

4444
[features]
45-
default = ["chat", "player_controller"]
45+
default = ["chat"]
4646
dynamic_linking = ["bevy/dynamic_linking"]
4747

4848
# both
@@ -58,7 +58,7 @@ skip_chunk_padding = []
5858
wireframe = []
5959
debug_ui = []
6060
ortho_camera = []
61-
player_controller = []
61+
lock_player = []
6262
physics_debug = []
6363
raycast_debug = []
6464
visual_debug = ["wireframe", "physics_debug", "raycast_debug"]

src/client/player/systems/controller.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use crate::prelude::*;
22

3-
// const SPAWN_POINT: Vec3 = Vec3::new(0.0, 32.0, 0.0);
3+
#[cfg(not(feature = "lock_player"))]
4+
const SPAWN_POINT: Vec3 = Vec3::new(0.0, 32.0, 0.0);
5+
#[cfg(feature = "lock_player")]
46
const SPAWN_POINT: Vec3 = Vec3::new(128.0, 96.0, -128.0);
57

68
pub fn setup_player_camera(mut commands: Commands) {
@@ -48,17 +50,25 @@ pub fn setup_controller_on_area_ready_system(
4850
},
4951
ActiveEvents::COLLISION_EVENTS,
5052
Velocity::zero(),
53+
#[cfg(feature = "lock_player")]
5154
RigidBody::Fixed,
55+
#[cfg(not(feature = "lock_player"))]
56+
RigidBody::Dynamic,
5257
Sleeping::disabled(),
5358
LockedAxes::ROTATION_LOCKED,
5459
AdditionalMassProperties::Mass(1.0),
5560
GravityScale(0.0),
5661
Ccd { enabled: true }, // Prevent clipping when going fast
5762
Transform::from_translation(SPAWN_POINT),
5863
LogicalPlayer,
64+
#[cfg(not(feature = "lock_player"))]
65+
FpsControllerInput {
66+
pitch: -TAU / 20.0,
67+
yaw: TAU * 5.0 / 12.0,
68+
..default()
69+
},
70+
#[cfg(feature = "lock_player")]
5971
FpsControllerInput {
60-
// pitch: -TAU / 20.0,
61-
// yaw: TAU * 5.0 / 12.0,
6272
pitch: 0.0,
6373
yaw: 0.0,
6474
..default()

0 commit comments

Comments
 (0)