feat: vehicle auto-repair (#493)
Co-authored-by: boredom1234 <roughuse82@gmail.com> Co-authored-by: Howdoiusekeyboard <howdoiusekeyboard@gmail.com>
This commit is contained in:
parent
edc52ccf2e
commit
cded8fa873
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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{};
|
||||
|
@ -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", [] {
|
||||
|
Reference in New Issue
Block a user