From 7ebe1e1a515a8cf969ec130026ecab84aac081b8 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Wed, 22 Feb 2023 19:42:12 +0800 Subject: [PATCH] Fix interact bug --- src/bot.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bot.rs b/src/bot.rs index 2908f5a..0a85e89 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -693,6 +693,9 @@ pub async fn process_command( ); } } + if found { + return "Successfully interacted with mob!".to_string(); + } let player_locations = state.player_locations.lock().unwrap().to_owned(); for (player, _) in player_locations { if player.entity_id.to_string() == segments[0] @@ -717,7 +720,7 @@ pub async fn process_command( } } if found { - return "Successfully interacted with entity!".to_string(); + return "Successfully interacted with player!".to_string(); } else { return "Unable to find entity!".to_string(); } @@ -748,6 +751,9 @@ pub async fn process_command( ); } } + if found { + return "Successfully attacked mob!".to_string(); + } let player_locations = state.player_locations.lock().unwrap().to_owned(); for (player, _) in player_locations { if player.entity_id.to_string() == segments[0] @@ -769,7 +775,7 @@ pub async fn process_command( } } if found { - return "Successfully attacked entity!".to_string(); + return "Successfully attacked player!".to_string(); } else { return "Unable to find entity!".to_string(); }