diff --git a/BigBaseV2/src/backend/backend.cpp b/BigBaseV2/src/backend/backend.cpp index 45044e9b..8a7c9bdd 100644 --- a/BigBaseV2/src/backend/backend.cpp +++ b/BigBaseV2/src/backend/backend.cpp @@ -86,6 +86,7 @@ namespace big looped::vehicle_is_targetable(); looped::vehicle_seatbelt(); looped::vehicle_speedo_meter(); + looped::vehicle_keep_vehicle_repaired(); script::get_current()->yield(); } diff --git a/BigBaseV2/src/backend/looped/looped.hpp b/BigBaseV2/src/backend/looped/looped.hpp index 772c44c1..b2367c28 100644 --- a/BigBaseV2/src/backend/looped/looped.hpp +++ b/BigBaseV2/src/backend/looped/looped.hpp @@ -54,6 +54,7 @@ namespace big static void vehicle_seatbelt(); static void vehicle_speedo_meter(); static void vehicle_turn_signals(); + static void vehicle_keep_vehicle_repaired(); static void weapons_ammo_special_type(); static void weapons_cage_gun(); diff --git a/BigBaseV2/src/backend/looped/vehicle/keep_vehicle_repaired.cpp b/BigBaseV2/src/backend/looped/vehicle/keep_vehicle_repaired.cpp new file mode 100644 index 00000000..04bb57ef --- /dev/null +++ b/BigBaseV2/src/backend/looped/vehicle/keep_vehicle_repaired.cpp @@ -0,0 +1,12 @@ +#include "backend/looped/looped.hpp" +#include "util/vehicle.hpp" + +namespace big +{ + void looped::vehicle_keep_vehicle_repaired() + { + if (g->vehicle.keep_vehicle_repaired && VEHICLE::GET_DOES_VEHICLE_HAVE_DAMAGE_DECALS(self::veh)) { + vehicle::repair(self::veh); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 856e3fe0..3a0a3596 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -270,6 +270,7 @@ namespace big bool seatbelt = false; bool turn_signals = false; bool vehicle_jump = false; + bool keep_vehicle_repaired = false; speedo_meter speedo_meter{}; rainbow_paint rainbow_paint{}; fly fly{}; diff --git a/BigBaseV2/src/views/vehicle/view_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_vehicle.cpp index 2329a43a..7069c759 100644 --- a/BigBaseV2/src/views/vehicle/view_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_vehicle.cpp @@ -20,6 +20,9 @@ namespace big vehicle::repair(self::veh); }); + ImGui::SameLine(); + ImGui::Checkbox("Keep Vehicle Repaired", &g->vehicle.keep_vehicle_repaired); + ImGui::Separator(); components::button("Teleport in PV", [] {