Fix issues with updater & crash with unlimited nitro #84

This commit is contained in:
Grinch_ 2023-01-04 08:47:31 +06:00
parent bcbb4d6418
commit 7008df4e95
4 changed files with 6 additions and 6 deletions

View File

@ -286,7 +286,7 @@ VehCustmzrMgr::VehCustmzrMgr()
m_Neon.m_nTrafficTimer = timer; m_Neon.m_nTrafficTimer = timer;
} }
if (m_Nitro.m_bEnabled && FindPlayerVehicle(-1, false)->m_nVehicleSubClass == VEHICLE_AUTOMOBILE) if (m_Nitro.m_bEnabled && pVeh && pVeh->m_nVehicleSubClass == VEHICLE_AUTOMOBILE)
{ {
patch::Set<BYTE>(0x969165, 0, true); // All cars have nitro patch::Set<BYTE>(0x969165, 0, true); // All cars have nitro
patch::Set<BYTE>(0x96918B, 0, true); // All taxis have nitro patch::Set<BYTE>(0x96918B, 0, true); // All taxis have nitro

View File

@ -8,7 +8,7 @@
#define IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS
#define MENU_NAME "Cheat Menu" #define MENU_NAME "Cheat Menu"
#define MENU_VERSION_NUMBER "3.5" #define MENU_VERSION_NUMBER "3.51"
#define MENU_VERSION MENU_VERSION_NUMBER #define MENU_VERSION MENU_VERSION_NUMBER
#define MENU_TITLE MENU_NAME " v" MENU_VERSION #define MENU_TITLE MENU_NAME " v" MENU_VERSION

View File

@ -11,7 +11,9 @@ MenuPage& menuPage = MenuPage::Get();
MenuPage::MenuPage() MenuPage::MenuPage()
: IPage<MenuPage>(ePageID::Menu, "Window.MenuPage", true) : IPage<MenuPage>(ePageID::Menu, "Window.MenuPage", true)
{ {
Events::initGameEvent += [this]() // This needs to run before initRwEvent
// Updates are checked in m_bAutoCheckUpdate
Events::initRwEvent.before += [this]()
{ {
m_bDiscordRPC = gConfig.Get("Menu.DiscordRPC", false); m_bDiscordRPC = gConfig.Get("Menu.DiscordRPC", false);
m_bAutoCheckUpdate = gConfig.Get("Menu.AutoCheckUpdate", true); m_bAutoCheckUpdate = gConfig.Get("Menu.AutoCheckUpdate", true);

View File

@ -52,9 +52,7 @@ void Updater::Process()
sscanf(buf, "[{\"name\": \"%f\",", &version); sscanf(buf, "[{\"name\": \"%f\",", &version);
if (version != 0.0f) if (version != 0.0f)
{ {
std::stringstream ss; latestVer = std::format("{}", version);
ss << std::fixed << std::setprecision(2) << version;
latestVer = ss.str();
break; break;
} }
} }