Rework Keep Vehicle Repaired to remove damage decals properly. (#2044)

* Keep Vehicle Repaired now uses CDecalManager to remove damage decals which allows it to ignore clan and livery decals.

* Added more conditions to call SET_VEHICLE_FIXED to fix things like the R88 breaking its shell off.
Fixed Seatbelt having inverted conditions.

* Fixed keep_vehicle_repaired repairing things it doesn't need to repair if godmode/always clean is on already.
Fixed spawn_vehicle_json not applying the radio station.

* Consolidated signature for CDecalMgr::ClearDecals and its static instance.
This commit is contained in:
gir489
2023-08-28 05:35:17 -04:00
committed by GitHub
parent ac41a7175b
commit 5eccb9def4
6 changed files with 39 additions and 12 deletions
+10
View File
@@ -1630,6 +1630,16 @@ namespace big
{
g_pointers->m_gta.m_activate_special_ability_patch = ptr.as<PVOID>();
}
},
// ClearDecals
{
"DCLMGR",
"48 8D 0D ? ? ? ? 41 83 C8 FF E8 ? ? ? ? 4C",
[](memory::handle ptr)
{
g_pointers->m_gta.m_decal_manager = ptr.add(3).rip().as<PVOID>();
g_pointers->m_gta.m_decal_manager_remove = ptr.add(0xC).rip().as<functions::decal_manager_remove>();
}
}
>(); // don't leave a trailing comma at the end