[VC] Add don't fall off bike

This commit is contained in:
Grinch_ 2022-02-20 00:32:25 +06:00
parent 91237fa152
commit e8c709a4dd
3 changed files with 25 additions and 6 deletions

View File

@ -88,7 +88,7 @@ size_t Locale::GetCurrentLocaleIndex()
return localeIndex;
}
Locale::eReturnCodes Locale::SetLocale(int index)
Locale::eReturnCodes Locale::SetLocale(size_t index)
{
if(m_pJson)
{

View File

@ -69,5 +69,5 @@ public:
index is the index of the language in the GetLocaleList() list
*/
static eReturnCodes SetLocale(int index);
static eReturnCodes SetLocale(size_t index);
};

View File

@ -106,7 +106,6 @@ Vehicle::Vehicle()
}
#ifdef GTASA
pPlayer->m_nPedFlags.CantBeKnockedOffBike = m_bDontFallBike ? 1 : 2;
if (m_UnlimitedNitro::m_bEnabled
&& BY_GAME(pVeh->m_nVehicleSubClass, pVeh->m_nVehicleClass, NULL) == VEHICLE_AUTOMOBILE)
@ -613,10 +612,30 @@ void Vehicle::ShowPage()
// }
#endif
ImGui::NextColumn();
#ifdef GTASA
Ui::CheckboxWithHint("Don't fall off bike", &m_bDontFallBike);
#endif
#ifndef GTA3
if (Ui::CheckboxWithHint("Don't fall off bike", &m_bDontFallBike))
{
if (m_bDontFallBike)
{
#ifdef GTASA
pPlayer->m_nPedFlags.CantBeKnockedOffBike = 1;
#elif GTAVC
patch::SetRaw(0x614C4E, (void*)"\x8B\x8D\x00\x00\x00\x00", 6);
patch::SetRaw(0x614CC5, (void*)"\x8B\x85\x00\x00\x00\x00", 6);
#endif
}
else
{
#ifdef GTASA
pPlayer->m_nPedFlags.CantBeKnockedOffBike = 2;
#elif GTAVC
patch::SetRaw(0x614C4E, (void*)"\x8B\x8D\xA8\x01\x00\x00", 6);
patch::SetRaw(0x614CC5, (void*)"\x8B\x85\xAC\x01\x00\x00", 6);
#endif
}
}
Ui::CheckboxAddress("Drive on water", BY_GAME(0x969152, 0xA10B81, NULL));
#endif
#ifdef GTASA