mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add server side check to stop stay when mounted
Add filter to allow telling other pets to stay when mounted
This commit is contained in:
parent
0648ba1bc6
commit
6a080c242c
@ -230,7 +230,8 @@ pub fn handle_toggle_stay(server: &mut Server, command_giver: EcsEntity, pet: Ec
|
||||
if prev_pet_pos.is_none() {
|
||||
new_pet_pos = state.ecs().read_storage::<Pos>().get(pet).copied();
|
||||
}
|
||||
if is_owner && within_mounting_range(positions.get(command_giver), positions.get(pet)) {
|
||||
if is_owner && within_mounting_range(positions.get(command_giver), positions.get(pet))
|
||||
&& state.ecs().read_storage::<Is<Mount>>().get(pet).is_none() {
|
||||
let _ = state
|
||||
.ecs()
|
||||
.write_storage::<PetState>()
|
||||
|
@ -958,6 +958,9 @@ impl PlayState for SessionState {
|
||||
matches!(client.state().ecs().read_storage::<comp::Alignment>().get(*e),
|
||||
Some(comp::Alignment::Owned(owner)) if Some(*owner) == client.uid())
|
||||
)
|
||||
.filter(|e|
|
||||
client.state().ecs().read_storage::<Is<Mount>>().get(*e).is_none()
|
||||
)
|
||||
.min_by_key(|e| {
|
||||
OrderedFloat(client
|
||||
.state()
|
||||
|
Loading…
Reference in New Issue
Block a user