From c434183a624388741cab585382e1427b95903cab Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Tue, 26 Oct 2021 18:08:26 +0600 Subject: [PATCH] Bug fixes --- src/menuinfo.h | 2 +- src/pch.h | 3 +-- src/player.cpp | 2 +- src/teleport.cpp | 6 ++--- src/vehicle.cpp | 12 ++++----- src/visual.cpp | 63 ++++++++++++++++++++++++++---------------------- 6 files changed, 46 insertions(+), 42 deletions(-) diff --git a/src/menuinfo.h b/src/menuinfo.h index 37b6686..2dbdd44 100644 --- a/src/menuinfo.h +++ b/src/menuinfo.h @@ -2,5 +2,5 @@ #define MENU_NAME "Cheat Menu" #define MENU_VERSION_NUMBER "3.0" #define MENU_VERSION MENU_VERSION_NUMBER"-beta" -#define BUILD_NUMBER "20211020" +#define BUILD_NUMBER "20211026" #define MENU_TITLE MENU_NAME " v" MENU_VERSION "(" BUILD_NUMBER ")" diff --git a/src/pch.h b/src/pch.h index 0ce49ea..6d13d73 100644 --- a/src/pch.h +++ b/src/pch.h @@ -50,8 +50,6 @@ #ifndef GTA3 #include #include -#include -#include #endif #ifdef GTASA @@ -62,6 +60,7 @@ #include #include #include +#include #endif #include "../depend/fla/IDaccess.h" diff --git a/src/player.cpp b/src/player.cpp index 0d8632f..bc76338 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -333,7 +333,7 @@ void Player::ChangePlayerModel(std::string& cat, std::string& key, std::string& CPlayerPed* player = FindPlayerPed(); #ifdef GTAVC - player->Undress(id.c_str()); + player->Undress(val.c_str()); CStreaming::LoadAllRequestedModels(false); player->Dress(); #else // GTA3 diff --git a/src/teleport.cpp b/src/teleport.cpp index 3dfdd45..f85b824 100644 --- a/src/teleport.cpp +++ b/src/teleport.cpp @@ -63,11 +63,11 @@ Teleport::Teleport() if (pVeh && BY_GAME(player->m_nPedFlags.bInVehicle, player->m_pVehicle, player->m_pVehicle)) { - BY_GAME(pVeh->Teleport(m_Teleport::m_fPos, false, false), pVeh->Teleport(m_Teleport::m_fPos), player->Teleport(m_Teleport::m_fPos)); + BY_GAME(pVeh->Teleport(m_Teleport::m_fPos, false), pVeh->Teleport(m_Teleport::m_fPos), player->Teleport(m_Teleport::m_fPos)); } else { - BY_GAME(player->Teleport(m_Teleport::m_fPos, false, false), player->Teleport(m_Teleport::m_fPos), player->Teleport(m_Teleport::m_fPos)); + BY_GAME(player->Teleport(m_Teleport::m_fPos, false), player->Teleport(m_Teleport::m_fPos), player->Teleport(m_Teleport::m_fPos)); } m_Teleport::m_bEnabled = false; @@ -133,7 +133,7 @@ void Teleport::TeleportPlayer(bool get_marker, CVector pos, int interior_id) else if (pVeh->m_nVehicleClass != VEHICLE_BOAT) reinterpret_cast(pVeh)->PlaceOnRoadProperly(); - BY_GAME(pVeh->m_nAreaCode, pVeh->m_nInterior) = interior_id; + BY_GAME(pVeh->m_nAreaCode, pVeh->m_nInterior, NULL) = interior_id; } else { diff --git a/src/vehicle.cpp b/src/vehicle.cpp index e6206c5..349e821 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -125,7 +125,7 @@ Vehicle::Vehicle() pPlayer->m_nPedFlags.CantBeKnockedOffBike = m_bDontFallBike ? 1 : 2; if (m_UnlimitedNitro::m_bEnabled - && BY_GAME(pVeh->m_nVehicleSubClass, pVeh->m_nVehicleClass) == VEHICLE_AUTOMOBILE) + && BY_GAME(pVeh->m_nVehicleSubClass, pVeh->m_nVehicleClass, NULL) == VEHICLE_AUTOMOBILE) { patch::Set(0x969165, 0, true); // All cars have nitro patch::Set(0x96918B, 0, true); // All taxis have nitro @@ -474,7 +474,7 @@ void Vehicle::SpawnVehicle(std::string& rootkey, std::string& vehName, std::stri } BY_GAME(veh->m_nDoorLock, veh->m_nLockStatus, veh->m_nDoorLock) = CARLOCK_UNLOCKED; #ifndef GTA3 - BY_GAME(veh->m_nAreaCode, veh->m_nInterior) = interior; + BY_GAME(veh->m_nAreaCode, veh->m_nInterior, NULL) = interior; #endif Command(CPools::GetVehicleRef(veh)); CStreaming::SetModelIsDeletable(imodel); @@ -640,14 +640,14 @@ void Vehicle::Draw() Ui::CheckboxWithHint("Don't fall off bike", &m_bDontFallBike); #endif #ifndef GTA3 - Ui::CheckboxAddress("Drive on water", BY_GAME(0x969152,0xA10B81)); + Ui::CheckboxAddress("Drive on water", BY_GAME(0x969152, 0xA10B81, NULL)); #endif #ifdef GTASA Ui::CheckboxAddressEx("Lock train camera", 0x52A52F, 171, 6); Ui::CheckboxAddress("Float away when hit", 0x969166); #endif #ifndef GTA3 - Ui::CheckboxAddress("Green traffic lights", BY_GAME(0x96914E,0xA10ADC)); + Ui::CheckboxAddress("Green traffic lights", BY_GAME(0x96914E, 0xA10ADC, NULL)); #endif #ifdef GTASA Ui::CheckboxAddress("Perfect handling", 0x96914C); @@ -881,8 +881,8 @@ void Vehicle::Draw() static std::vector color { - {"Black", BY_GAME(0x969151, 0xA10B82)}, - {"Pink", BY_GAME(0x969150, 0xA10B26)} + {"Black", BY_GAME(0x969151, 0xA10B82, NULL)}, + {"Pink", BY_GAME(0x969150, 0xA10B26, NULL)} }; Ui::RadioButtonAddress("Color", color); ImGui::Spacing(); diff --git a/src/visual.cpp b/src/visual.cpp index 69af161..bff8c3c 100644 --- a/src/visual.cpp +++ b/src/visual.cpp @@ -139,12 +139,14 @@ void Visual::GenerateTimecycFile() break; case 3: buffer = "\n// FOGGY\n"; +#ifdef GTAVC case 4: buffer = "\n// EXTRA SUNNY\n"; case 5: buffer = "\n// HURRICANE\n"; case 6: buffer = "\n// EXTRA COLORS (INTERIORS)\n// These colours do not belong to a weather type but can be set by the level designers for interiors.\n"; +#endif } #ifdef GTA3 @@ -156,6 +158,38 @@ void Visual::GenerateTimecycFile() for (size_t j = 0; j < 24; ++j) { + +#ifdef GTAVC + if (i == 6) //EXTRA COLORS + { + buffer = "// Extra Color " + std::to_string(j); + + static std::string intNames[] = { + "Maibu Club", "Strip Club", "Hotel", "Bank", "Police HQ", "Mall", "Rifle Range", "Mansion", "Dirtring", "Blood ring", + "Hotring", "Concert Hall", "Auntie Poulets", "Intro at Docks", "Biker Bar", "Intro Cafe Dark Room", "Studio" + }; + + if (j < 18) + { + buffer += "(" + intNames[j] + ")"; + } + } + else + { +#endif + buffer = "// " + std::to_string(j) + " "; + if (j < 12) + { + buffer += "AM\n"; + } + else + { + buffer += "PM\n"; + } +#ifdef GTAVC + } +#endif + #ifdef GTA3 size_t val = i + TOTAL_WEATHERS*j; buffer += std::format("{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {} {}", @@ -174,35 +208,6 @@ void Visual::GenerateTimecycFile() GetTCVal(m_fPostFxRed, val), GetTCVal(m_fPostFxGreen, val), GetTCVal(m_fPostFxBlue, val), GetTCVal(m_fPostFxAlpha, val) ); #elif GTAVC - - if (i == 6) //EXTRA COLORS - { - buffer = "// Extra Color " + std::to_string(j); - - static std::string intNames[] = { - "Maibu Club", "Strip Club", "Hotel", "Bank", "Police HQ", "Mall", "Rifle Range", "Mansion", "Dirtring", "Blood ring", - "Hotring", "Concert Hall", "Auntie Poulets", "Intro at Docks", "Biker Bar", "Intro Cafe Dark Room", "Studio" - - }; - - if (j < 18) - { - buffer += "(" + intNames[j] + ")"; - } - } - else - { - buffer = "// " + std::to_string(j) + " "; - if (j < 12) - { - buffer += "AM\n"; - } - else - { - buffer += "PM\n"; - } - } - size_t val = TOTAL_WEATHERS * i + j; buffer += std::format("{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {} {}", GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val),