mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed non-dismounting teleportation
This commit is contained in:
parent
68491dde55
commit
5988237b3d
@ -230,26 +230,28 @@ fn position_mut<T>(
|
||||
dismount_volume: Option<bool>,
|
||||
f: impl for<'a> FnOnce(&'a mut comp::Pos) -> T,
|
||||
) -> CmdResult<T> {
|
||||
let entity = if dismount_volume.unwrap_or(true) {
|
||||
if dismount_volume.unwrap_or(true) {
|
||||
server
|
||||
.state
|
||||
.ecs()
|
||||
.write_storage::<Is<VolumeRider>>()
|
||||
.remove(entity);
|
||||
entity
|
||||
} else {
|
||||
server
|
||||
.state
|
||||
.read_storage::<Is<Rider>>()
|
||||
.get(entity)
|
||||
.and_then(|is_rider| {
|
||||
server
|
||||
.state
|
||||
.ecs()
|
||||
.read_resource::<UidAllocator>()
|
||||
.retrieve_entity_internal(is_rider.mount.into())
|
||||
})
|
||||
.or(server
|
||||
}
|
||||
|
||||
let entity = server
|
||||
.state
|
||||
.read_storage::<Is<Rider>>()
|
||||
.get(entity)
|
||||
.and_then(|is_rider| {
|
||||
server
|
||||
.state
|
||||
.ecs()
|
||||
.read_resource::<UidAllocator>()
|
||||
.retrieve_entity_internal(is_rider.mount.into())
|
||||
})
|
||||
.map(Ok)
|
||||
.or_else(|| {
|
||||
server
|
||||
.state
|
||||
.read_storage::<Is<VolumeRider>>()
|
||||
.get(entity)
|
||||
@ -265,9 +267,8 @@ fn position_mut<T>(
|
||||
.retrieve_entity_internal(uid.into())?),
|
||||
})
|
||||
})
|
||||
.transpose()?)
|
||||
.unwrap_or(entity)
|
||||
};
|
||||
})
|
||||
.unwrap_or(Ok(entity))?;
|
||||
|
||||
let mut maybe_pos = None;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user