diff --git a/scripts/gtav-classes.cmake b/scripts/gtav-classes.cmake index fca74cb9..e75930dd 100644 --- a/scripts/gtav-classes.cmake +++ b/scripts/gtav-classes.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( gtav_classes GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git - GIT_TAG 468161a36d95a355d9783eef5b245f3f1542e2bb + GIT_TAG 9da68ec82769c684068023c00ac5e5acd7836c97 GIT_PROGRESS TRUE CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/src/backend/looped/vehicle/boost_behavior.cpp b/src/backend/looped/vehicle/boost_behavior.cpp index 3514cdd4..a4386105 100644 --- a/src/backend/looped/vehicle/boost_behavior.cpp +++ b/src/backend/looped/vehicle/boost_behavior.cpp @@ -9,28 +9,49 @@ namespace big { auto* const vehicle = g_local_player->m_vehicle; - if (vehicle && VEHICLE::GET_HAS_ROCKET_BOOST(self::veh)) + bool is_rocket = VEHICLE::GET_HAS_ROCKET_BOOST(self::veh); + bool is_kers = VEHICLE::GET_VEHICLE_HAS_KERS(self::veh); + + if (vehicle && (is_rocket || is_kers)) { - if (g.vehicle.boost_behavior == eBoostBehaviors::INSTANT_REFIL && (vehicle->m_boost == 0.f || !vehicle->m_boost_state))// Instant Refill + if (g.vehicle.boost_behavior == eBoostBehaviors::INSTANT_REFIL) // Instant Refill { - vehicle->m_boost_allow_recharge = true; - vehicle->m_boost = 3.f; - } - else if (g.vehicle.boost_behavior == eBoostBehaviors::INFINITE_BOOST)// Infinite Boost - { - vehicle->m_boost_allow_recharge = true; - vehicle->m_boost = 3.f; - } - else if (g.vehicle.boost_behavior == eBoostBehaviors::HOLD_FOR_INFINITE) - { - if (vehicle->m_boost_state && PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_ROCKET_BOOST)) + if (is_rocket && (vehicle->m_boost == 0.f || !vehicle->m_boost_state)) { vehicle->m_boost_allow_recharge = true; vehicle->m_boost = 3.f; } - else if (vehicle->m_boost_state) + else if (is_kers && vehicle->m_kers_boost == 0.f) { - vehicle->m_boost_state = false; + vehicle->m_kers_boost = vehicle->m_kers_boost_max; + } + } + else if (g.vehicle.boost_behavior == eBoostBehaviors::INFINITE_BOOST)// Infinite + { + vehicle->m_boost_allow_recharge = true; + vehicle->m_boost = 3.f; + vehicle->m_kers_boost = vehicle->m_kers_boost_max - 0.01f; + } + else if (g.vehicle.boost_behavior == eBoostBehaviors::HOLD_FOR_INFINITE) //Hold for Boost + { + if (PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_ROCKET_BOOST) || PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_FLY_BOOST)) + { + if (is_rocket) + { + if (vehicle->m_boost_state) + { + vehicle->m_boost_allow_recharge = true; + vehicle->m_boost = 3.f; + } + else if (vehicle->m_boost_state) + { + vehicle->m_boost_state = false; + } + } + else + { + vehicle->m_kers_boost = vehicle->m_kers_boost_max - 0.01f; + } } } } diff --git a/src/backend/looped/vehicle/keep_vehicle_repaired.cpp b/src/backend/looped/vehicle/keep_vehicle_repaired.cpp index 2aca7e9d..15fe772e 100644 --- a/src/backend/looped/vehicle/keep_vehicle_repaired.cpp +++ b/src/backend/looped/vehicle/keep_vehicle_repaired.cpp @@ -10,8 +10,32 @@ namespace big virtual void on_tick() override { - if (VEHICLE::GET_DOES_VEHICLE_HAVE_DAMAGE_DECALS(self::veh)) - vehicle::repair(self::veh); + auto veh = self::veh; + if (!ENTITY::IS_ENTITY_A_VEHICLE(veh) || !entity::take_control_of(veh, 0)) + { + return; + } + if (VEHICLE::GET_DOES_VEHICLE_HAVE_DAMAGE_DECALS(veh)) + { + if (VEHICLE::IS_VEHICLE_BUMPER_BOUNCING(veh, TRUE) || VEHICLE::GET_VEHICLE_NUM_OF_BROKEN_OFF_PARTS(veh) > 0) + { + VEHICLE::SET_VEHICLE_FIXED(veh); + } + + if (!VEHICLE::IS_VEHICLE_WINDOW_INTACT(veh, 7)) //Rear window + VEHICLE::FIX_VEHICLE_WINDOW(veh, 7); + + int clan_logo_counter = GRAPHICS::DOES_VEHICLE_HAVE_CREW_EMBLEM(veh, 0) * 10; + GRAPHICS::REMOVE_DECALS_FROM_VEHICLE(veh); + while (clan_logo_counter-- > 0 && !GRAPHICS::DOES_VEHICLE_HAVE_CREW_EMBLEM(veh, 0)) + { + vehicle_helper::add_clan_logo_to_vehicle(veh, self::ped); + script::get_current()->yield(10ms); + } + + VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(veh); + VEHICLE::SET_VEHICLE_DIRT_LEVEL(veh, 0.f); + } } }; diff --git a/src/util/vehicle.hpp b/src/util/vehicle.hpp index 503c2201..05385c1c 100644 --- a/src/util/vehicle.hpp +++ b/src/util/vehicle.hpp @@ -161,7 +161,6 @@ namespace big::vehicle } VEHICLE::SET_VEHICLE_FIXED(veh); - VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(veh); VEHICLE::SET_VEHICLE_DIRT_LEVEL(veh, 0.f); return true;