[III] Fix crash with vehicle spawning #69

This commit is contained in:
Grinch_ 2022-12-31 02:29:55 +06:00
parent 05a66d5cb0
commit c150899f20
3 changed files with 6 additions and 2 deletions

View File

@ -8,8 +8,8 @@
#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.3" #define MENU_VERSION_NUMBER "3.5"
#define MENU_VERSION MENU_VERSION_NUMBER"-beta" #define MENU_VERSION MENU_VERSION_NUMBER
#define MENU_TITLE MENU_NAME " v" MENU_VERSION #define MENU_TITLE MENU_NAME " v" MENU_VERSION
#ifdef GTASA #ifdef GTASA

View File

@ -166,10 +166,12 @@ void MenuPage::Draw()
gConfig.Set("Overlay.ShowLocationName", Overlay::m_bLocName); gConfig.Set("Overlay.ShowLocationName", Overlay::m_bLocName);
} }
#ifndef GTA3
if (ImGui::Checkbox(TEXT("Menu.ShowModelInfo"), &Overlay::m_bModelInfo)) if (ImGui::Checkbox(TEXT("Menu.ShowModelInfo"), &Overlay::m_bModelInfo))
{ {
gConfig.Set("Overlay.ShowModelInfo", Overlay::m_bModelInfo); gConfig.Set("Overlay.ShowModelInfo", Overlay::m_bModelInfo);
} }
#endif
ImGui::NextColumn(); ImGui::NextColumn();

View File

@ -451,7 +451,9 @@ void VehiclePage::SpawnVehicle(std::string& rootkey, std::string& vehName, std::
player->GetOrientation(x, y, z); player->GetOrientation(x, y, z);
veh->SetOrientation(x, y, z); veh->SetOrientation(x, y, z);
#endif #endif
CWorld::Remove(player);
Command<Commands::WARP_CHAR_INTO_CAR>(hplayer, hveh); Command<Commands::WARP_CHAR_INTO_CAR>(hplayer, hveh);
CWorld::Add(player);
Util::SetCarForwardSpeed(veh, speed); Util::SetCarForwardSpeed(veh, speed);
} }
else else