From 26729c6f612fd162ab26bf272bc4f71552be0dec Mon Sep 17 00:00:00 2001 From: yuni Date: Sun, 17 Nov 2024 21:39:31 +0100 Subject: [PATCH] prevent entering vehicles with interact key when starting a conversation --- src/actor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/actor.rs b/src/actor.rs index d4d2b2d..a757cca 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -475,6 +475,8 @@ pub fn handle_input( let player_entity = player.get_single().unwrap(); if keyboard_input.just_pressed(settings.key_interact) { + let mut done = false; + // Talking to people let objects: Vec<(chat::Talker, &Transform)> = q_talker .iter() @@ -487,10 +489,12 @@ pub fn handle_input( ew_conv.send(chat::StartConversationEvent { talker: talker.clone(), }); + done = true; } } + // Entering Vehicles - if q_player_drives.is_empty() { + if !done && q_player_drives.is_empty() { // Sort vehicles by their distance to the player let objects: Vec<((Entity, &Actor, Option<&MessageOnVehicleEntry>), &Transform)> = q_vehicles