From 7c1ac8383dc085926488063d4a437fdc3cfec2ba Mon Sep 17 00:00:00 2001 From: Regynate <64607261+Regynate@users.noreply.github.com> Date: Sat, 25 Nov 2023 06:44:21 +0300 Subject: [PATCH] Brake Boosting: apply to player only --- ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp b/ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp index 78fc7c126..577242f6c 100644 --- a/ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp @@ -7,11 +7,12 @@ static void OnTick() { static const Hash blimpHash = "BLIMP"_hash; - for (Vehicle veh : GetAllVehs()) - { + if (IS_PED_IN_ANY_VEHICLE(PLAYER_PED_ID()), false) { + Vehicle veh = GET_VEHICLE_PED_IS_IN(PLAYER_PED_ID(), false); + Hash vehModel = GET_ENTITY_MODEL(veh); int vehClass = GET_VEHICLE_CLASS(veh); - + // Exclude helis since the "braking" flag seems to be always set for those // Also manually exclude blimps since those don't seem to be categorized as either of those if (vehClass != 15 && vehModel != blimpHash && Memory::IsVehicleBraking(veh)) @@ -28,4 +29,4 @@ REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo .Id = "veh_brakeboost", .IsTimed = true, } -); \ No newline at end of file +);