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:
@ -87,10 +87,12 @@ pub fn handle_npc_interaction(server: &mut Server, interactor: EcsEntity, npc_en
|
|||||||
.write_storage::<comp::Agent>()
|
.write_storage::<comp::Agent>()
|
||||||
.get_mut(npc_entity)
|
.get_mut(npc_entity)
|
||||||
{
|
{
|
||||||
if let Some(interactor_uid) = state.ecs().uid_from_entity(interactor) {
|
if agent.target.is_none() {
|
||||||
agent
|
if let Some(interactor_uid) = state.ecs().uid_from_entity(interactor) {
|
||||||
.inbox
|
agent
|
||||||
.push_back(AgentEvent::Talk(interactor_uid, Subject::Regular));
|
.inbox
|
||||||
|
.push_back(AgentEvent::Talk(interactor_uid, Subject::Regular));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user