Fix game crash when loading save/ new game

This commit is contained in:
Grinch_ 2020-12-20 00:05:12 +06:00
parent e458cbc95e
commit 5b1903df0c
5 changed files with 34 additions and 10 deletions

29
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10240.0\\ucrt",
"${DIRECTX9_SDK_DIR}/include",
"${PLUGIN_SDK_DIR}/plugin_sa",
"${PLUGIN_SDK_DIR}/plugin_sa/game_sa",
"${PLUGIN_SDK_DIR}/shared",
"${PLUGIN_SDK_DIR}/shared/game"
],
"defines": [
"GTASA",
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.10240.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe",
"cStandard": "c99",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x86",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}

View File

@ -1,5 +1,4 @@
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"files.associations": {
"iosfwd": "cpp",
"xlocbuf": "cpp",

View File

@ -380,15 +380,13 @@ void Menu::Main()
ImGui::Columns(1);
ImGui::Dummy(ImVec2(0, 10));
ImGui::TextWrapped("Special thanks to,");
ImGui::TextWrapped("Thanks to,");
ImGui::Columns(2, NULL, false);
ImGui::TextWrapped("Dowglas_");
ImGui::TextWrapped("Israel");
ImGui::NextColumn();
ImGui::TextWrapped("Junior-Djjr");
ImGui::TextWrapped("Um-geek");
ImGui::Columns(1);

View File

@ -85,16 +85,15 @@ Vehicle::Vehicle()
{
uint timer = CTimer::m_snTimeInMilliseconds;
static CPlayerPed *player = FindPlayerPed();
static int hplayer = CPools::GetPedRef(player);
CPlayerPed *player = FindPlayerPed();
CVehicle *veh = player->m_pVehicle;
if (Command<Commands::IS_CHAR_IN_ANY_CAR>(hplayer))
if (player && veh)
{
int hveh = CPools::GetVehicleRef(veh);
player->m_nPedFlags.CantBeKnockedOffBike = dont_fall_bike ? 1 : 2;
Command<Commands::SET_CAR_HEAVY>(hveh, veh_heavy);
Command<Commands::SET_CHAR_CAN_BE_KNOCKED_OFF_BIKE>(hplayer, !dont_fall_bike);
Command<Commands::SET_CAR_WATERTIGHT>(hveh, veh_watertight);
if (unlimited_nitro::enabled && player->m_pVehicle->m_nVehicleSubClass == VEHICLE_AUTOMOBILE)

View File

@ -16,7 +16,6 @@
#include <fstream>
#include <functional>
#include <memory>
#include <stdlib.h>
#include <sstream>
#include <vector>
#include <windows.h>