Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Fix issues with updater & crash with unlimited nitro #84
Browse files Browse the repository at this point in the history
  • Loading branch information
user-grinch committed Jan 4, 2023
1 parent bcbb4d6 commit 7008df4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/custom/vehcustmzr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ VehCustmzrMgr::VehCustmzrMgr()
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>(0x96918B, 0, true); // All taxis have nitro
Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define IMGUI_DEFINE_MATH_OPERATORS

#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_TITLE MENU_NAME " v" MENU_VERSION

Expand Down
4 changes: 3 additions & 1 deletion src/pages/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ MenuPage& menuPage = MenuPage::Get();
MenuPage::MenuPage()
: 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_bAutoCheckUpdate = gConfig.Get("Menu.AutoCheckUpdate", true);
Expand Down
4 changes: 1 addition & 3 deletions src/utils/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ void Updater::Process()
sscanf(buf, "[{\"name\": \"%f\",", &version);
if (version != 0.0f)
{
std::stringstream ss;
ss << std::fixed << std::setprecision(2) << version;
latestVer = ss.str();
latestVer = std::format("{}", version);
break;
}
}
Expand Down

0 comments on commit 7008df4

Please sign in to comment.