From 17cce9302087bb57166f79dc25db42fff3d80e87 Mon Sep 17 00:00:00 2001 From: anim_state <82110489+lagcompensation@users.noreply.github.com> Date: Fri, 5 Jul 2024 07:42:32 +0300 Subject: [PATCH 1/3] Update core.cpp some minor fixes btw i think he looks nice --- cstrike/core.cpp | 57 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/cstrike/core.cpp b/cstrike/core.cpp index 3753c7d..709f982 100644 --- a/cstrike/core.cpp +++ b/cstrike/core.cpp @@ -34,6 +34,9 @@ // used: product version #include "sdk/interfaces/iengineclient.h" +// used: jthread +#include + bool CORE::GetWorkingPath(wchar_t* wszDestination) { const wchar_t* wszModuleName = MEM::GetModuleBaseFileName(static_cast(hDll), true); @@ -57,20 +60,20 @@ bool CORE::GetWorkingPath(wchar_t* wszDestination) return true; } -static bool Setup(HMODULE hModule) +static void Setup() { #ifdef CS_LOG_CONSOLE if (!L::AttachConsole(CS_XOR(L"asphyxia developer-mode"))) { CS_ASSERT(false); // failed to attach console - return false; + return; } #endif #ifdef CS_LOG_FILE if (!L::OpenFile(CS_XOR(L"asphyxia.log"))) { CS_ASSERT(false); // failed to open file - return false; + return; } #endif L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("logging system initialization completed"); @@ -79,14 +82,14 @@ static bool Setup(HMODULE hModule) if (!MEM::Setup()) { CS_ASSERT(false); // failed to setup memory system - return false; + return; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("memory system initialization completed"); if (!MATH::Setup()) { CS_ASSERT(false); // failed to setup math system - return false; + return; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("math system initialization completed"); @@ -94,14 +97,14 @@ static bool Setup(HMODULE hModule) if (!I::Setup()) { CS_ASSERT(false); // failed to setup interfaces - return false; + return; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("interfaces initialization completed"); if (!SDK::Setup()) { CS_ASSERT(false); // failed to setup sdk - return false; + return; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("sdk initialization completed"); @@ -109,7 +112,7 @@ static bool Setup(HMODULE hModule) if (!IPT::Setup()) { CS_ASSERT(false); // failed to setup input system - return false; + return; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("input system initialization completed"); @@ -124,33 +127,33 @@ static bool Setup(HMODULE hModule) if (!F::Setup()) { CS_ASSERT(false); // failed to setup features - return false; + return; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("features initialization completed"); - if (!SCHEMA::Setup(CS_XOR(L"schema_client.txt"), CS_XOR("client.dll"))) + // iterate all valid modules for schema + std::vector vecNeededModules = { CS_XOR("client.dll"), CS_XOR("engine.dll"), CS_XOR("schemasystem.dll") }; + for (auto& szModule : vecNeededModules) { - CS_ASSERT(false); // failed to setup schema system - return false; + if (!SCHEMA::Setup(CS_XOR(L"schema.txt"), szModule.c_str())) + { + CS_ASSERT(false); // failed to setup schema system + return; + } } - //if (!SCHEMA::Setup(CS_XOR(L"schema_server.txt"), CS_XOR("server.dll"))) - //{ - // CS_ASSERT(false); // failed to setup schema system - // return false; - //} L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("schema system initialization completed"); if (!CONVAR::Dump(CS_XOR(L"convars.txt"))) { CS_ASSERT(false); // failed to setup convars system - return false; + return; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("convars dumped completed, output: \"convars.txt\""); if (!CONVAR::Setup()) { CS_ASSERT(false); // failed to setup convars system - return false; + return; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("convars system initialization completed"); @@ -158,7 +161,7 @@ static bool Setup(HMODULE hModule) if (!H::Setup()) { CS_ASSERT(false); // failed to setup hooks - return false; + return; } L_PRINT(LOG_NONE) << CS_XOR("hooks initialization completed"); @@ -174,7 +177,6 @@ static bool Setup(HMODULE hModule) L_PRINT(LOG_WARNING) << L::SetColor(LOG_COLOR_FORE_YELLOW | LOG_COLOR_FORE_INTENSITY) << CS_XOR("version mismatch! local CS2 version: ") << CS_PRODUCTSTRINGVERSION << CS_XOR(", current CS2 version: ") << I::Engine->GetProductVersionString() << CS_XOR(". asphyxia might not function as normal."); L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_CYAN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("asphyxia initialization completed, version: ") << CS_STRINGIFY(CS_VERSION); - return true; } // @todo: some of those may crash while closing process, because we dont have any dependencies from the game modules, it means them can be unloaded and destruct interfaces etc before our module | modify ldrlist? @@ -214,6 +216,9 @@ extern "C" BOOL WINAPI _CRT_INIT(HMODULE hModule, DWORD dwReason, LPVOID lpReser BOOL APIENTRY CoreEntryPoint(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) { + // disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL) + DisableThreadLibraryCalls(hModule); + // process destroy of the cheat before crt calls atexit table if (dwReason == DLL_PROCESS_DETACH) Destroy(); @@ -240,15 +245,11 @@ BOOL APIENTRY CoreEntryPoint(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) // save our module handle CORE::hDll = hModule; - // check did we perform main initialization successfully - if (!Setup(hModule)) - { - // undo the things we've done - Destroy(); - return FALSE; - } + // create main thread + std::jthread{ []() { Setup(); } }.detach(); // create panic thread, it isn't critical error if it fails + // UPD: idc about std::jthread for panic thread btw he didn't work anyway if (const HANDLE hThread = ::CreateThread(nullptr, 0U, &PanicThread, hModule, 0UL, nullptr); hThread != nullptr) ::CloseHandle(hThread); } From 25da2e84d0dad347a587f629d4c9e84e205f0454 Mon Sep 17 00:00:00 2001 From: anim_state <82110489+lagcompensation@users.noreply.github.com> Date: Fri, 5 Jul 2024 07:47:35 +0300 Subject: [PATCH 2/3] Update core.cpp ahh shit --- cstrike/core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cstrike/core.cpp b/cstrike/core.cpp index 709f982..13c0cf2 100644 --- a/cstrike/core.cpp +++ b/cstrike/core.cpp @@ -132,7 +132,7 @@ static void Setup() L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("features initialization completed"); // iterate all valid modules for schema - std::vector vecNeededModules = { CS_XOR("client.dll"), CS_XOR("engine.dll"), CS_XOR("schemasystem.dll") }; + std::vector vecNeededModules = { CS_XOR("client.dll"), CS_XOR("engine2.dll"), CS_XOR("schemasystem.dll") }; for (auto& szModule : vecNeededModules) { if (!SCHEMA::Setup(CS_XOR(L"schema.txt"), szModule.c_str())) From 0387a9f8b207fa561b29ede58802ab0cfabad528 Mon Sep 17 00:00:00 2001 From: anim_state <82110489+lagcompensation@users.noreply.github.com> Date: Fri, 12 Jul 2024 06:13:25 +0300 Subject: [PATCH 3/3] major update etc some minor fixes added disable model occlusion( set PVS to false ) --- cstrike/common.h | 2 +- cstrike/core.cpp | 42 ++++++++++++++++-------------- cstrike/core/hooks.cpp | 6 ++++- cstrike/core/hooks.h | 6 ++--- cstrike/core/interfaces.cpp | 3 +++ cstrike/core/interfaces.h | 2 ++ cstrike/cstrike.vcxproj | 1 + cstrike/cstrike.vcxproj.filters | 3 +++ cstrike/features/visuals/chams.cpp | 8 +++--- cstrike/sdk/entity.cpp | 12 ++++----- cstrike/sdk/interfaces/ipvs.h | 13 +++++++++ cstrike/utilities/fnv1a.h | 7 ++--- 12 files changed, 64 insertions(+), 41 deletions(-) create mode 100644 cstrike/sdk/interfaces/ipvs.h diff --git a/cstrike/common.h b/cstrike/common.h index a2bbd8c..ce7d8cf 100644 --- a/cstrike/common.h +++ b/cstrike/common.h @@ -12,7 +12,7 @@ * - used to verify game version */ -#define CS_PRODUCTSTRINGVERSION CS_XOR("1.40.2.0") +#define CS_PRODUCTSTRINGVERSION CS_XOR("1.40.2.1") /* * game's modules diff --git a/cstrike/core.cpp b/cstrike/core.cpp index 13c0cf2..1d1ef47 100644 --- a/cstrike/core.cpp +++ b/cstrike/core.cpp @@ -34,9 +34,6 @@ // used: product version #include "sdk/interfaces/iengineclient.h" -// used: jthread -#include - bool CORE::GetWorkingPath(wchar_t* wszDestination) { const wchar_t* wszModuleName = MEM::GetModuleBaseFileName(static_cast(hDll), true); @@ -60,20 +57,20 @@ bool CORE::GetWorkingPath(wchar_t* wszDestination) return true; } -static void Setup() +static bool Setup(HMODULE hModule) { #ifdef CS_LOG_CONSOLE if (!L::AttachConsole(CS_XOR(L"asphyxia developer-mode"))) { CS_ASSERT(false); // failed to attach console - return; + return false; } #endif #ifdef CS_LOG_FILE if (!L::OpenFile(CS_XOR(L"asphyxia.log"))) { CS_ASSERT(false); // failed to open file - return; + return false; } #endif L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("logging system initialization completed"); @@ -82,14 +79,14 @@ static void Setup() if (!MEM::Setup()) { CS_ASSERT(false); // failed to setup memory system - return; + return false; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("memory system initialization completed"); if (!MATH::Setup()) { CS_ASSERT(false); // failed to setup math system - return; + return false; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("math system initialization completed"); @@ -97,14 +94,14 @@ static void Setup() if (!I::Setup()) { CS_ASSERT(false); // failed to setup interfaces - return; + return false; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("interfaces initialization completed"); if (!SDK::Setup()) { CS_ASSERT(false); // failed to setup sdk - return; + return false; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("sdk initialization completed"); @@ -112,7 +109,7 @@ static void Setup() if (!IPT::Setup()) { CS_ASSERT(false); // failed to setup input system - return; + return false; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("input system initialization completed"); @@ -127,7 +124,7 @@ static void Setup() if (!F::Setup()) { CS_ASSERT(false); // failed to setup features - return; + return false; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("features initialization completed"); @@ -138,7 +135,7 @@ static void Setup() if (!SCHEMA::Setup(CS_XOR(L"schema.txt"), szModule.c_str())) { CS_ASSERT(false); // failed to setup schema system - return; + return false; } } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("schema system initialization completed"); @@ -146,14 +143,14 @@ static void Setup() if (!CONVAR::Dump(CS_XOR(L"convars.txt"))) { CS_ASSERT(false); // failed to setup convars system - return; + return false; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("convars dumped completed, output: \"convars.txt\""); if (!CONVAR::Setup()) { CS_ASSERT(false); // failed to setup convars system - return; + return false; } L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("convars system initialization completed"); @@ -161,7 +158,7 @@ static void Setup() if (!H::Setup()) { CS_ASSERT(false); // failed to setup hooks - return; + return false; } L_PRINT(LOG_NONE) << CS_XOR("hooks initialization completed"); @@ -177,6 +174,7 @@ static void Setup() L_PRINT(LOG_WARNING) << L::SetColor(LOG_COLOR_FORE_YELLOW | LOG_COLOR_FORE_INTENSITY) << CS_XOR("version mismatch! local CS2 version: ") << CS_PRODUCTSTRINGVERSION << CS_XOR(", current CS2 version: ") << I::Engine->GetProductVersionString() << CS_XOR(". asphyxia might not function as normal."); L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_CYAN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("asphyxia initialization completed, version: ") << CS_STRINGIFY(CS_VERSION); + return true; } // @todo: some of those may crash while closing process, because we dont have any dependencies from the game modules, it means them can be unloaded and destruct interfaces etc before our module | modify ldrlist? @@ -216,7 +214,7 @@ extern "C" BOOL WINAPI _CRT_INIT(HMODULE hModule, DWORD dwReason, LPVOID lpReser BOOL APIENTRY CoreEntryPoint(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) { - // disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL) + // Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL). This can reduce the size of the working set for some applications DisableThreadLibraryCalls(hModule); // process destroy of the cheat before crt calls atexit table @@ -245,11 +243,15 @@ BOOL APIENTRY CoreEntryPoint(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) // save our module handle CORE::hDll = hModule; - // create main thread - std::jthread{ []() { Setup(); } }.detach(); + // check did we perform main initialization successfully + if (!Setup(hModule)) + { + // undo the things we've done + Destroy(); + return FALSE; + } // create panic thread, it isn't critical error if it fails - // UPD: idc about std::jthread for panic thread btw he didn't work anyway if (const HANDLE hThread = ::CreateThread(nullptr, 0U, &PanicThread, hModule, 0UL, nullptr); hThread != nullptr) ::CloseHandle(hThread); } diff --git a/cstrike/core/hooks.cpp b/cstrike/core/hooks.cpp index b21cd70..76bfba8 100644 --- a/cstrike/core/hooks.cpp +++ b/cstrike/core/hooks.cpp @@ -13,6 +13,7 @@ #include "../sdk/interfaces/inetworkclientservice.h" #include "../sdk/interfaces/iglobalvars.h" #include "../sdk/interfaces/imaterialsystem.h" +#include "../sdk/interfaces/ipvs.h" // used: viewsetup #include "../sdk/datatypes/viewsetup.h" @@ -123,7 +124,7 @@ bool H::Setup() return false; L_PRINT(LOG_INFO) << CS_XOR("\"DrawObject\" hook has been created"); - if (!hkIsRelativeMouseMode.Create(MEM::GetVFunc(I::InputSystem, VTABLE::SDL::ISRELATIVEMOUSEMODE), reinterpret_cast(&IsRelativeMouseMode))) + if (!hkIsRelativeMouseMode.Create(MEM::GetVFunc(I::InputSystem, VTABLE::INPUTSYSTEM::ISRELATIVEMOUSEMODE), reinterpret_cast(&IsRelativeMouseMode))) return false; L_PRINT(LOG_INFO) << CS_XOR("\"IsRelativeMouseMode\" hook has been created"); @@ -252,6 +253,9 @@ __int64* CS_FASTCALL H::LevelInit(void* pClientModeShared, const char* szNewMap) if (I::GlobalVars == nullptr) I::GlobalVars = *reinterpret_cast(MEM::ResolveRelativeAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 0D ? ? ? ? 48 89 41")), 0x3, 0x7)); + // disable model occlusion + I::PVS->Set(false); + return oLevelInit(pClientModeShared, szNewMap); } diff --git a/cstrike/core/hooks.h b/cstrike/core/hooks.h index 77b39ed..a231f19 100644 --- a/cstrike/core/hooks.h +++ b/cstrike/core/hooks.h @@ -40,11 +40,11 @@ namespace VTABLE }; } - namespace SDL + namespace INPUTSYSTEM { enum { - ISRELATIVEMOUSEMODE = 78u, + ISRELATIVEMOUSEMODE = 78U, }; } } @@ -76,8 +76,6 @@ namespace H __int64 CS_FASTCALL LevelShutdown(void* pClientModeShared); void CS_FASTCALL OverrideView(void* pClientModeCSNormal, CViewSetup* pSetup); void CS_FASTCALL DrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2); - - // sdl functions void* IsRelativeMouseMode(void* pThisptr, bool bActive); /* @section: managers */ diff --git a/cstrike/core/interfaces.cpp b/cstrike/core/interfaces.cpp index a6ef66a..1075532 100644 --- a/cstrike/core/interfaces.cpp +++ b/cstrike/core/interfaces.cpp @@ -176,6 +176,9 @@ bool I::Setup() GlobalVars = *reinterpret_cast(MEM::ResolveRelativeAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 0D ? ? ? ? 48 89 41")), 0x3, 0x7)); bSuccess &= (GlobalVars != nullptr); + PVS = reinterpret_cast(MEM::ResolveRelativeAddress(MEM::FindPattern(ENGINE2_DLL, CS_XOR("48 8D 0D ? ? ? ? 33 D2 FF 50")), 0x3, 0x7)); + bSuccess &= (PVS != nullptr); + return bSuccess; } diff --git a/cstrike/core/interfaces.h b/cstrike/core/interfaces.h index dd41efe..1a4bf0f 100644 --- a/cstrike/core/interfaces.h +++ b/cstrike/core/interfaces.h @@ -40,6 +40,7 @@ class INetworkClientService; class IMaterialSystem2; class IResourceSystem; class CResourceHandleUtils; +class CPVS; // [d3d] struct struct ID3D11Device; @@ -72,4 +73,5 @@ namespace I inline IMaterialSystem2* MaterialSystem2 = nullptr; inline IResourceSystem* ResourceSystem = nullptr; inline CResourceHandleUtils* ResourceHandleUtils = nullptr; + inline CPVS* PVS = nullptr; } diff --git a/cstrike/cstrike.vcxproj b/cstrike/cstrike.vcxproj index f5ddcb6..b8f726f 100644 --- a/cstrike/cstrike.vcxproj +++ b/cstrike/cstrike.vcxproj @@ -161,6 +161,7 @@ + diff --git a/cstrike/cstrike.vcxproj.filters b/cstrike/cstrike.vcxproj.filters index cd32b98..736f548 100644 --- a/cstrike/cstrike.vcxproj.filters +++ b/cstrike/cstrike.vcxproj.filters @@ -308,6 +308,9 @@ + + sdk\interfaces + diff --git a/cstrike/features/visuals/chams.cpp b/cstrike/features/visuals/chams.cpp index 7795d1f..f45a7d5 100644 --- a/cstrike/features/visuals/chams.cpp +++ b/cstrike/features/visuals/chams.cpp @@ -100,15 +100,15 @@ bool F::VISUALS::CHAMS::OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx if (CRT::StringCompare(pClassInfo->szName, CS_XOR("C_CSPlayerPawn")) != 0) return false; - auto pPawn = I::GameResourceService->pGameEntitySystem->Get(hOwner); - if (pPawn == nullptr) + auto pPlayerPawn = I::GameResourceService->pGameEntitySystem->Get(hOwner); + if (pPlayerPawn == nullptr) return false; - if (!pPawn->IsOtherEnemy(SDK::LocalPawn)) + if (!pPlayerPawn->IsOtherEnemy(SDK::LocalPawn)) return false; // alive state - if (pPawn->GetHealth() == 0) + if (pPlayerPawn->GetHealth() <= 0) return false; return OverrideMaterial(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2); diff --git a/cstrike/sdk/entity.cpp b/cstrike/sdk/entity.cpp index fa9b0f3..d60e07f 100644 --- a/cstrike/sdk/entity.cpp +++ b/cstrike/sdk/entity.cpp @@ -20,15 +20,15 @@ CCSPlayerController* CCSPlayerController::GetLocalPlayerController() const Vector_t& CCSPlayerController::GetPawnOrigin() { - CBaseHandle hPawn = this->GetPawnHandle(); - if (!hPawn.IsValid()) + CBaseHandle hPawnHandle = this->GetPawnHandle(); + if (!hPawnHandle.IsValid()) return vecEmpty; - C_CSPlayerPawn* pPawn = I::GameResourceService->pGameEntitySystem->Get(hPawn); - if (pPawn == nullptr) + C_CSPlayerPawn* pPlayerPawn = I::GameResourceService->pGameEntitySystem->Get(hPawnHandle); + if (pPlayerPawn == nullptr) return vecEmpty; - return pPawn->GetSceneOrigin(); + return pPlayerPawn->GetSceneOrigin(); } C_BaseEntity* C_BaseEntity::GetLocalPlayer() @@ -101,7 +101,7 @@ bool C_CSWeaponBaseGun::CanPrimaryAttack(const int nWeaponType, const float flSe if (nWeaponType == WEAPONTYPE_KNIFE) return true; - // check do weapon have ammo + // check do weapon have ammo if (this->GetClip1() <= 0) return false; diff --git a/cstrike/sdk/interfaces/ipvs.h b/cstrike/sdk/interfaces/ipvs.h new file mode 100644 index 0000000..5f68eb8 --- /dev/null +++ b/cstrike/sdk/interfaces/ipvs.h @@ -0,0 +1,13 @@ +#pragma once + +// used: MEM::CallVFunc +#include "../../utilities/memory.h" + +class CPVS +{ +public: + void Set(bool bState) + { + MEM::CallVFunc(this, bState); + } +}; diff --git a/cstrike/utilities/fnv1a.h b/cstrike/utilities/fnv1a.h index 76c9e2d..86a4adc 100644 --- a/cstrike/utilities/fnv1a.h +++ b/cstrike/utilities/fnv1a.h @@ -33,11 +33,8 @@ namespace FNV1A const std::size_t nLength = CRT::StringLength(szString); for (std::size_t i = 0U; i < nLength; ++i) - { - uKey ^= szString[i]; - uKey *= ullPrime; - } + uKey = (uKey ^ szString[i]) * ullPrime; return uKey; } -} \ No newline at end of file +}