mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Check for existing target before initiating interaction
This commit is contained in:
parent
4d62b9b937
commit
5983c87120
@ -87,6 +87,7 @@ pub fn handle_npc_interaction(server: &mut Server, interactor: EcsEntity, npc_en
|
||||
.write_storage::<comp::Agent>()
|
||||
.get_mut(npc_entity)
|
||||
{
|
||||
if agent.target.is_none() {
|
||||
if let Some(interactor_uid) = state.ecs().uid_from_entity(interactor) {
|
||||
agent
|
||||
.inbox
|
||||
@ -94,6 +95,7 @@ pub fn handle_npc_interaction(server: &mut Server, interactor: EcsEntity, npc_en
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// FIXME: Make mounting more robust, avoid bidirectional links.
|
||||
pub fn handle_mount(server: &mut Server, mounter: EcsEntity, mountee: EcsEntity) {
|
||||
|
Loading…
Reference in New Issue
Block a user