mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix typos, don't insert Controller if it doesn't already exist in the
mount system so that Controller components are not added to entities client side
This commit is contained in:
@ -14,7 +14,7 @@ pub enum ClientMsg {
|
|||||||
},
|
},
|
||||||
/// Request `ClientState::Registered` from an ingame state
|
/// Request `ClientState::Registered` from an ingame state
|
||||||
ExitIngame,
|
ExitIngame,
|
||||||
/// Request `ClientState::Specator` from a registered or ingame state
|
/// Request `ClientState::Spectator` from a registered or ingame state
|
||||||
Spectate,
|
Spectate,
|
||||||
ControllerInputs(comp::ControllerInputs),
|
ControllerInputs(comp::ControllerInputs),
|
||||||
ControlEvent(comp::ControlEvent),
|
ControlEvent(comp::ControlEvent),
|
||||||
|
@ -341,7 +341,11 @@ impl<'a> System<'a> for Sys {
|
|||||||
ControlEvent::Unmount => server_emitter.emit(ServerEvent::Unmount(entity)),
|
ControlEvent::Unmount => server_emitter.emit(ServerEvent::Unmount(entity)),
|
||||||
ControlEvent::InventoryManip(manip) => {
|
ControlEvent::InventoryManip(manip) => {
|
||||||
server_emitter.emit(ServerEvent::InventoryManip(entity, manip))
|
server_emitter.emit(ServerEvent::InventoryManip(entity, manip))
|
||||||
} //ControlEvent::Respawn => server_emitter.emit(ServerEvent::Unmount(entity)),
|
} /*ControlEvent::Respawn => {
|
||||||
|
if state.is_dead {
|
||||||
|
server_emitter.emit(ServerEvent::Respawn(entity)),
|
||||||
|
}
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,7 +426,6 @@ impl<'a> System<'a> for Sys {
|
|||||||
&& can_climb(body),
|
&& can_climb(body),
|
||||||
physics.on_wall,
|
physics.on_wall,
|
||||||
) {
|
) {
|
||||||
println!("here 1");
|
|
||||||
character.movement = Climb;
|
character.movement = Climb;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -553,7 +556,6 @@ impl<'a> System<'a> for Sys {
|
|||||||
&& can_climb(body),
|
&& can_climb(body),
|
||||||
physics.on_wall,
|
physics.on_wall,
|
||||||
) {
|
) {
|
||||||
println!("here 2");
|
|
||||||
character.movement = Climb;
|
character.movement = Climb;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -671,7 +673,6 @@ impl<'a> System<'a> for Sys {
|
|||||||
if !inputs.glide.is_pressed() {
|
if !inputs.glide.is_pressed() {
|
||||||
character.movement = Fall;
|
character.movement = Fall;
|
||||||
} else if let (Some(_wall_dir), true) = (physics.on_wall, can_climb(body)) {
|
} else if let (Some(_wall_dir), true) = (physics.on_wall, can_climb(body)) {
|
||||||
println!("here 3");
|
|
||||||
character.movement = Climb;
|
character.movement = Climb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,13 +59,12 @@ impl<'a> System<'a> for Sys {
|
|||||||
let _ = orientations.insert(mounter, ori);
|
let _ = orientations.insert(mounter, ori);
|
||||||
let _ = velocities.insert(mounter, vel);
|
let _ = velocities.insert(mounter, vel);
|
||||||
}
|
}
|
||||||
let _ = controllers.insert(
|
controllers.get_mut(entity).map(|controller| {
|
||||||
entity,
|
*controller = Controller {
|
||||||
Controller {
|
|
||||||
inputs,
|
inputs,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
}
|
||||||
);
|
});
|
||||||
} else {
|
} else {
|
||||||
*(mount_states.get_mut_unchecked()) = MountState::Unmounted;
|
*(mount_states.get_mut_unchecked()) = MountState::Unmounted;
|
||||||
}
|
}
|
||||||
|
@ -755,7 +755,7 @@ impl Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ServerEvent::ExitIngame { entity } => {
|
ServerEvent::ExitIngame { entity } => {
|
||||||
// Create new entity with just `Clienti`, `Uid`, and `Player` components
|
// Create new entity with just `Client`, `Uid`, and `Player` components
|
||||||
// Easier than checking and removing all other known components
|
// Easier than checking and removing all other known components
|
||||||
// Note: If other `ServerEvent`s are referring to this entity they will be
|
// Note: If other `ServerEvent`s are referring to this entity they will be
|
||||||
// disrupted
|
// disrupted
|
||||||
|
Reference in New Issue
Block a user