From bc754af8530c7baf4b60c92797a2757fc8401a8c Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Sun, 27 Dec 2020 01:40:02 +0600 Subject: [PATCH] Bug fixes 1. Fixed more issues with modloader 2. Fixed player model being broken after going through enex 3. Fixed cop caps being spawned locked 4. Fixed stuff in Visuals/Menu not working --- src/Menu.cpp | 5 +++-- src/NeonAPI.cpp | 2 -- src/NeonAPI.h | 2 -- src/Paint.cpp | 4 +--- src/Player.cpp | 8 +++++++- src/Ui.cpp | 8 ++++---- src/Vehicle.cpp | 5 +++-- src/pch.h | 2 +- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/Menu.cpp b/src/Menu.cpp index 2626e8a..f2163a7 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -389,8 +389,9 @@ void Menu::Main() ImGui::Columns(1); ImGui::Dummy(ImVec2(0, 10)); - ImGui::TextWrapped("Thanks to,"); - ImGui::TextWrapped("Junior-Djjr"); + ImGui::TextWrapped("If you find bugs or have suggestions, let me know on discord."); + ImGui::Dummy(ImVec2(0, 10)); + ImGui::TextWrapped("Thanks to Junior-Djjr"); ImGui::Dummy(ImVec2(0, 10)); ImGui::TextWrapped("Copyright GPLv3 2019-2021 Grinch_"); diff --git a/src/NeonAPI.cpp b/src/NeonAPI.cpp index bf106f5..672cec8 100644 --- a/src/NeonAPI.cpp +++ b/src/NeonAPI.cpp @@ -1,8 +1,6 @@ #include "pch.h" #include "NeonAPI.h" -bool NeonAPI::api_installed = false; -HMODULE NeonAPI::hapi = false; VehicleExtendedData NeonAPI::VehNeon; RwTexture* NeonAPI::neon_texture = nullptr; diff --git a/src/NeonAPI.h b/src/NeonAPI.h index 85ceb5a..e29b922 100644 --- a/src/NeonAPI.h +++ b/src/NeonAPI.h @@ -3,8 +3,6 @@ class NeonAPI { private: - static bool api_installed; - static HMODULE hapi; static RwTexture* neon_texture; class NeonData { diff --git a/src/Paint.cpp b/src/Paint.cpp index 5a33724..57ac225 100644 --- a/src/Paint.cpp +++ b/src/Paint.cpp @@ -12,9 +12,7 @@ Paint::Paint() Events::initGameEvent += [] { - std::string dir_path = std::string(".\\CheatMenu\\vehicles\\paintjobs\\").c_str(); - - for (auto &p : fs::recursive_directory_iterator(dir_path)) + for (auto &p : fs::recursive_directory_iterator(PLUGIN_PATH((char*)"\\CheatMenu\\vehicles\\paintjobs\\"))) { if (p.path().extension() == ".png") { diff --git a/src/Player.cpp b/src/Player.cpp index 4487976..c423959 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -25,6 +25,13 @@ Player::Player() { Events::initGameEvent += [] { + /* + Nop call to CClothes::RebuildPlayerIfNeeded + So player model doesn't get fked + This probably gonna fuck me up in future but oh well + */ + patch::Nop(0x44070A,5,false); + aim_skin_changer = config.GetValue("aim_skin_changer", false); Util::LoadTexturesInDirRecursive(PLUGIN_PATH((char*)"CheatMenu\\clothes\\"), ".jpg", search_categories, clothes_vec); @@ -190,7 +197,6 @@ void Player::Main() ImGui::SameLine(); if (ImGui::Button("Suicide", ImVec2(Ui::GetSize(2)))) player->m_fHealth = 0.0; - ImGui::Spacing(); if (ImGui::BeginTabBar("Player", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) diff --git a/src/Ui.cpp b/src/Ui.cpp index f4244b3..090c782 100644 --- a/src/Ui.cpp +++ b/src/Ui.cpp @@ -678,10 +678,10 @@ void Ui::ColorPickerAddress(const char* label, int base_addr, ImVec4&& default_c if (ImGui::Button("Reset to default", Ui::GetSize())) { - patch::SetRaw(base_addr, &default_color.w, 1, false); - patch::SetRaw(base_addr + 1, &default_color.x, 1, false); - patch::SetRaw(base_addr + 2, &default_color.y, 1, false); - patch::SetRaw(base_addr + 3, &default_color.z, 1, false); + patch::Set(base_addr, default_color.x, false); + patch::Set(base_addr + 1, default_color.y, false); + patch::Set(base_addr + 2, default_color.z, false); + patch::Set(base_addr + 3, default_color.w, false); } ImGui::Spacing(); diff --git a/src/Vehicle.cpp b/src/Vehicle.cpp index 4887e7b..d14ca79 100644 --- a/src/Vehicle.cpp +++ b/src/Vehicle.cpp @@ -492,7 +492,7 @@ void Vehicle::SpawnVehicle(std::string &smodel) int hveh = 0; if (spawner::spawn_inside) { - Command(imodel, pos.x, pos.y, pos.z + 4.0f, &hveh); + Command(imodel, pos.x, pos.y, pos.z + 2.0f, &hveh); veh = CPools::GetVehicle(hveh); veh->SetHeading(player->GetHeading()); Command(hplayer, hveh); @@ -502,10 +502,11 @@ void Vehicle::SpawnVehicle(std::string &smodel) { player->TransformFromObjectSpace(pos, CVector(0, 10, 0)); - Command(imodel, pos.x, pos.y, pos.z + 4.0f, &hveh); + Command(imodel, pos.x, pos.y, pos.z + 2.0f, &hveh); veh = CPools::GetVehicle(hveh); veh->SetHeading(player->GetHeading()+55.0f); } + veh->m_nDoorLock = CARLOCK_UNLOCKED; veh->m_nAreaCode = interior; Command(CPools::GetVehicleRef(veh)); CStreaming::SetModelIsDeletable(imodel); diff --git a/src/pch.h b/src/pch.h index 55383a0..5bdf5c6 100644 --- a/src/pch.h +++ b/src/pch.h @@ -4,7 +4,7 @@ #define INPUT_BUFFER_SIZE 64 #define SPAWN_PED_LIMIT 20 #define MENU_VERSION "2.5-beta" -#define BUILD_NUMBER "20201226" +#define BUILD_NUMBER "20201227" #define STB_IMAGE_IMPLEMENTATION #define DISCORD_INVITE "https://discord.gg/ZzW7kmf" #define GITHUB_LINK "https://github.com/user-grinch/Cheat-Menu"