From 8d01f497e7bcf396fe1260b7e06a6d9a79f11d3a Mon Sep 17 00:00:00 2001 From: gir489 <100792176+gir489returns@users.noreply.github.com> Date: Sun, 16 Jul 2023 17:31:27 -0400 Subject: [PATCH] =?UTF-8?q?Fixed=20issue=20#1727=20DIRT=5FLEVEL=20is=20cal?= =?UTF-8?q?ling=20natives=20inside=20the=20presentati=E2=80=A6=20(#1732)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/vehicle/view_fun_vehicle.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/views/vehicle/view_fun_vehicle.cpp b/src/views/vehicle/view_fun_vehicle.cpp index 75b8b27e..173f3075 100644 --- a/src/views/vehicle/view_fun_vehicle.cpp +++ b/src/views/vehicle/view_fun_vehicle.cpp @@ -136,28 +136,21 @@ namespace big ImGui::SeparatorText("DIRT_LEVEL"_T.data()); { - if (!ENTITY::DOES_ENTITY_EXIST(self::veh)) + if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr) { ImGui::Text("PLEASE_ENTER_VEHICLE"_T.data()); - return; } - - if (g.vehicle.keep_vehicle_clean) + else if (g.vehicle.keep_vehicle_clean) { ImGui::Text("KEEP_VEHICLE_CLEAN"_T.data()); - return; } - - if (g.vehicle.keep_vehicle_repaired) + else if (g.vehicle.keep_vehicle_repaired) { ImGui::Text("KEEP_VEHICLE_REPAIRED"_T.data()); - return; } - - float dirt_level = VEHICLE::GET_VEHICLE_DIRT_LEVEL(self::veh); - if (ImGui::SliderFloat("DIRT_LEVEL"_T.data(), &dirt_level, 0.f, 15.f, "%.1f")) + else { - VEHICLE::SET_VEHICLE_DIRT_LEVEL(self::veh, dirt_level); + ImGui::SliderFloat("DIRT_LEVEL"_T.data(), &g_local_player->m_vehicle->m_dirt_level, 0.f, 15.f, "%.1f"); } }