mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Mounting fix
This commit is contained in:
@ -153,15 +153,6 @@ impl<'a> System<'a> for Sys {
|
|||||||
// Do nothing
|
// Do nothing
|
||||||
continue;
|
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
|
// Enter stunned state if poise damage is enough
|
||||||
if let Some(mut poise) = poises.get_mut(entity) {
|
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);
|
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(
|
let j = JoinData::new(
|
||||||
&join_struct,
|
&join_struct,
|
||||||
&read_data.lazy_update,
|
&read_data.lazy_update,
|
||||||
|
@ -53,12 +53,12 @@ impl<'a> System<'a> for Sys {
|
|||||||
MountState::MountedBy(mounter_uid) => {
|
MountState::MountedBy(mounter_uid) => {
|
||||||
// Note: currently controller events are not passed through since none of them
|
// Note: currently controller events are not passed through since none of them
|
||||||
// are currently relevant to controlling the mounted entity
|
// 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())
|
.retrieve_entity_internal(mounter_uid.id())
|
||||||
.and_then(|mounter| {
|
.and_then(|mounter| {
|
||||||
controllers
|
controllers
|
||||||
.get(mounter)
|
.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())
|
// 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) {
|
if let Some(controller) = controllers.get_mut(entity) {
|
||||||
*controller = Controller {
|
*controller = Controller {
|
||||||
inputs,
|
inputs,
|
||||||
|
queued_inputs,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user