aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-10-03 19:32:14 +0200
committerGitHub <noreply@github.com>2023-10-03 19:32:14 +0200
commit2a3be90915b547f21c1dc574a83b24c988cf6b72 (patch)
tree681fe8de17a3cc6397562ab585f6b99a0b1bb672
parentd6f0cd508dfb81a9af7afa5ac70b8b2496665037 (diff)
downloadNorthstarLauncher-1.19.3.tar.gz
NorthstarLauncher-1.19.3.zip
Revert "Add a safeguard to map command" (#561)v1.19.3-rc1v1.19.3
Revert "Add a safeguard to map command (#529)" This reverts commit cde626b041e72d749c54d0be8119fe3604bbf4f0.
-rw-r--r--NorthstarDLL/util/printmaps.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/NorthstarDLL/util/printmaps.cpp b/NorthstarDLL/util/printmaps.cpp
index abd4e1ea..dd825bff 100644
--- a/NorthstarDLL/util/printmaps.cpp
+++ b/NorthstarDLL/util/printmaps.cpp
@@ -31,12 +31,6 @@ struct MapVPKInfo
// our current list of maps in the game
std::vector<MapVPKInfo> vMapList;
-typedef void (*Host_Map_helperType)(const CCommand&, void*);
-typedef void (*Host_Changelevel_fType)(const CCommand&);
-
-Host_Map_helperType Host_Map_helper;
-Host_Changelevel_fType Host_Changelevel_f;
-
void RefreshMapList()
{
// Only update the maps list every 10 seconds max to we avoid constantly reading fs
@@ -188,30 +182,6 @@ void ConCommand_maps(const CCommand& args)
spdlog::info("({}) {}", PrintMapSource.at(map.source), map.name);
}
-// clang-format off
-AUTOHOOK(Host_Map_f, engine.dll + 0x15B340, void, __fastcall, (const CCommand& args))
-// clang-format on
-{
- RefreshMapList();
-
- if (args.ArgC() > 1 &&
- std::find_if(vMapList.begin(), vMapList.end(), [&](MapVPKInfo map) -> bool { return map.name == args.Arg(1); }) == vMapList.end())
- {
- spdlog::warn("Map load failed: {} not found or invalid", args.Arg(1));
- return;
- }
- else if (args.ArgC() == 1)
- {
- spdlog::warn("Map load failed: no map name provided");
- return;
- }
-
- if (*R2::g_pServerState >= R2::server_state_t::ss_active)
- return Host_Changelevel_f(args);
- else
- return Host_Map_helper(args, nullptr);
-}
-
void InitialiseMapsPrint()
{
AUTOHOOK_DISPATCH()
@@ -219,9 +189,3 @@ void InitialiseMapsPrint()
ConCommand* mapsCommand = R2::g_pCVar->FindCommand("maps");
mapsCommand->m_pCommandCallback = ConCommand_maps;
}
-
-ON_DLL_LOAD("engine.dll", Host_Map_f, (CModule module))
-{
- Host_Map_helper = module.Offset(0x15AEF0).RCast<Host_Map_helperType>();
- Host_Changelevel_f = module.Offset(0x15AAD0).RCast<Host_Changelevel_fType>();
-}