aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/shared/exploit_fixes
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2023-12-14 12:00:26 +0000
committerGitHub <noreply@github.com>2023-12-14 13:00:26 +0100
commit0976a3500e6774258322ab2bc80ebd515c175e77 (patch)
tree8573693b05b741c9a988265bc137820f908c922e /NorthstarDLL/shared/exploit_fixes
parent8a4107191b782d087a94511e9fb6f85fcb7c43d9 (diff)
downloadNorthstarLauncher-0976a3500e6774258322ab2bc80ebd515c175e77.tar.gz
NorthstarLauncher-0976a3500e6774258322ab2bc80ebd515c175e77.zip
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)
Diffstat (limited to 'NorthstarDLL/shared/exploit_fixes')
-rw-r--r--NorthstarDLL/shared/exploit_fixes/exploitfixes.cpp8
1 files changed, 8 insertions, 0 deletions
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");
}