From 0976a3500e6774258322ab2bc80ebd515c175e77 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:00:26 +0000 Subject: Rework `-vanilla` to be a vanilla compatibility mode (#601) Old `-vanilla` behaviour is now handled by `-nonorthstardll`. New squirrel constant called `VANILLA`. Set to true when in vanilla compatibility mode. Differences when in vanilla compatibility mode: - Doesn't restrict server commands (same as `-norestrictservercommands`) - Doesn't block FairFight screenshot functions - Doesn't do Atlas-related stuff (except for mainmenupromos) --- NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'NorthstarDLL/shared/exploit_fixes') diff --git a/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp b/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp index 2a0a9c2c..8821a40d 100644 --- a/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp +++ b/NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp @@ -5,6 +5,7 @@ #include "engine/r2engine.h" #include "client/r2client.h" #include "core/math/vector.h" +#include "core/vanilla.h" AUTOHOOK_INIT() @@ -33,6 +34,8 @@ AUTOHOOK(CLC_Screenshot_WriteToBuffer, engine.dll + 0x22AF20, bool, __fastcall, (void* thisptr, void* buffer)) // 48 89 5C 24 ? 57 48 83 EC 20 8B 42 10 // clang-format on { + if (g_pVanillaCompatibility->GetVanillaCompatibility()) + return CLC_Screenshot_WriteToBuffer(thisptr, buffer); return false; } @@ -41,6 +44,8 @@ AUTOHOOK(CLC_Screenshot_ReadFromBuffer, engine.dll + 0x221F00, bool, __fastcall, (void* thisptr, void* buffer)) // 48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B DA 48 8B 52 38 // clang-format on { + if (g_pVanillaCompatibility->GetVanillaCompatibility()) + return CLC_Screenshot_ReadFromBuffer(thisptr, buffer); return false; } @@ -261,6 +266,9 @@ bool, __fastcall, (const char* pModName)) // 48 83 EC 28 48 8B 0D ? ? ? ? 48 8D R2::g_pModName = new char[iSize + 1]; strcpy(R2::g_pModName, pModName); + if (g_pVanillaCompatibility->GetVanillaCompatibility()) + return false; + return (!strcmp("r2", pModName) || !strcmp("r1", pModName)) && !Tier0::CommandLine()->CheckParm("-norestrictservercommands"); } -- cgit v1.2.3