From 54977c79f11967b95cfab6d200e9b8b8719b5b82 Mon Sep 17 00:00:00 2001 From: sardelka9515 Date: Sun, 21 Aug 2022 14:12:44 +0800 Subject: [PATCH] Fix unintended carjacking --- RageCoop.Client/Main.cs | 15 ++++++++++++++- RageCoop.Client/Properties/AssemblyInfo.cs | 4 ++-- RageCoop.Server/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/RageCoop.Client/Main.cs b/RageCoop.Client/Main.cs index 04e39f8..1602e8c 100644 --- a/RageCoop.Client/Main.cs +++ b/RageCoop.Client/Main.cs @@ -309,7 +309,20 @@ namespace RageCoop.Client if (V!=null) { var seat = P.GetNearestSeat(V); - P.Task.EnterVehicle(V, seat); + var p = V.GetPedOnSeat(seat); + if (p != null && !p.IsDead) + { + for(int i = -1; i < V.PassengerCapacity; i++) + { + seat = (VehicleSeat)i; + p = V.GetPedOnSeat(seat); + if (p == null || p.IsDead) + { + break; + } + } + } + P.Task.EnterVehicle(V, seat,-1,5,EnterVehicleFlags.None); } } } diff --git a/RageCoop.Client/Properties/AssemblyInfo.cs b/RageCoop.Client/Properties/AssemblyInfo.cs index 7e2aae0..93a1814 100644 --- a/RageCoop.Client/Properties/AssemblyInfo.cs +++ b/RageCoop.Client/Properties/AssemblyInfo.cs @@ -16,7 +16,7 @@ using System.Resources; // Version informationr( -[assembly: AssemblyVersion("1.5.1.31")] -[assembly: AssemblyFileVersion("1.5.1.31")] +[assembly: AssemblyVersion("1.5.1.36")] +[assembly: AssemblyFileVersion("1.5.1.36")] [assembly: NeutralResourcesLanguageAttribute( "en-US" )] diff --git a/RageCoop.Server/Properties/AssemblyInfo.cs b/RageCoop.Server/Properties/AssemblyInfo.cs index be32f5e..fdd228e 100644 --- a/RageCoop.Server/Properties/AssemblyInfo.cs +++ b/RageCoop.Server/Properties/AssemblyInfo.cs @@ -15,7 +15,7 @@ using System.Resources; [assembly: AssemblyCulture("")] // Version informationr( -[assembly: AssemblyVersion("1.5.1.30")] -[assembly: AssemblyFileVersion("1.5.1.30")] +[assembly: AssemblyVersion("1.5.1.31")] +[assembly: AssemblyFileVersion("1.5.1.31")] [assembly: NeutralResourcesLanguageAttribute( "en-US" )]