mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Mounting fix
This commit is contained in:
parent
41342deab6
commit
0c7ea992c2
@ -153,15 +153,6 @@ impl<'a> System<'a> for Sys {
|
||||
// Do nothing
|
||||
continue;
|
||||
}
|
||||
// If mounted, character state is controlled by mount
|
||||
// TODO: Make mounting a state
|
||||
if let Some(Mounting(_)) = read_data.mountings.get(entity) {
|
||||
let sit_state = CharacterState::Sit {};
|
||||
if char_state.get_unchecked() != &sit_state {
|
||||
*char_state.get_mut_unchecked() = sit_state;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Enter stunned state if poise damage is enough
|
||||
if let Some(mut poise) = poises.get_mut(entity) {
|
||||
@ -317,6 +308,17 @@ impl<'a> System<'a> for Sys {
|
||||
incorporate_update(&mut join_struct, state_update);
|
||||
}
|
||||
|
||||
// Mounted occurs after control actions have been handled
|
||||
// If mounted, character state is controlled by mount
|
||||
// TODO: Make mounting a state
|
||||
if let Some(Mounting(_)) = read_data.mountings.get(entity) {
|
||||
let sit_state = CharacterState::Sit {};
|
||||
if join_struct.char_state.get_unchecked() != &sit_state {
|
||||
*join_struct.char_state.get_mut_unchecked() = sit_state;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let j = JoinData::new(
|
||||
&join_struct,
|
||||
&read_data.lazy_update,
|
||||
|
@ -53,12 +53,12 @@ impl<'a> System<'a> for Sys {
|
||||
MountState::MountedBy(mounter_uid) => {
|
||||
// Note: currently controller events are not passed through since none of them
|
||||
// are currently relevant to controlling the mounted entity
|
||||
if let Some((inputs, mounter)) = uid_allocator
|
||||
if let Some((inputs, queued_inputs, mounter)) = uid_allocator
|
||||
.retrieve_entity_internal(mounter_uid.id())
|
||||
.and_then(|mounter| {
|
||||
controllers
|
||||
.get(mounter)
|
||||
.map(|c| (c.inputs.clone(), mounter))
|
||||
.map(|c| (c.inputs.clone(), c.queued_inputs.clone(), mounter))
|
||||
})
|
||||
{
|
||||
// TODO: consider joining on these? (remember we can use .maybe())
|
||||
@ -75,6 +75,7 @@ impl<'a> System<'a> for Sys {
|
||||
if let Some(controller) = controllers.get_mut(entity) {
|
||||
*controller = Controller {
|
||||
inputs,
|
||||
queued_inputs,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user