feat: vehicle auto-repair (#493)

Co-authored-by: boredom1234 <roughuse82@gmail.com>
Co-authored-by: Howdoiusekeyboard <howdoiusekeyboard@gmail.com>
This commit is contained in:
GeopJr 2022-10-21 18:22:52 +03:00 committed by GitHub
parent edc52ccf2e
commit cded8fa873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 0 deletions

View File

@ -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();
}

View File

@ -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();

View File

@ -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);
}
}
}

View File

@ -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{};

View File

@ -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", [] {