Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Remove CS2Fixes patches
Browse files Browse the repository at this point in the history
  • Loading branch information
marqdevx committed Mar 3, 2024
1 parent 80c8cc1 commit ea870b8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 110 deletions.
1 change: 0 additions & 1 deletion AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ for sdk_name in MMSPlugin.sdks:
binary.sources += [
'src/cs2fixes.cpp',
'src/mempatch.cpp',
'src/patches.cpp',
'src/cvars.cpp',
'src/adminsystem.cpp',
'src/commands.cpp',
Expand Down
5 changes: 0 additions & 5 deletions src/cs2fixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "common.h"
#include "commands.h"
#include "detours.h"
#include "patches.h"
#include "icvar.h"
#include "interface.h"
#include "tier0/dbg.h"
Expand Down Expand Up @@ -197,9 +196,6 @@ bool CS2Fixes::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool
if (!addresses::Initialize(g_GameConfig))
bRequiredInitLoaded = false;

/*if (!InitPatches(g_GameConfig))
bRequiredInitLoaded = false;
*/
if (!InitDetours(g_GameConfig))
bRequiredInitLoaded = false;

Expand Down Expand Up @@ -295,7 +291,6 @@ bool CS2Fixes::Unload(char *error, size_t maxlen)
coaches.Purge();

FlushAllDetours();
//UndoPatches();
RemoveTimers();
UnregisterEventListeners();

Expand Down
104 changes: 0 additions & 104 deletions src/patches.cpp
Original file line number Diff line number Diff line change
@@ -1,105 +1 @@
/**
* =============================================================================
* CS2Fixes
* Copyright (C) 2023 Source2ZE
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "common.h"
#include "mempatch.h"
#include "icvar.h"
#include "irecipientfilter.h"
#include "entity/ccsplayercontroller.h"
#include "entity/ccsplayerpawn.h"
#include "entity/cbasemodelentity.h"
#include "addresses.h"
#include "patches.h"

#include "tier0/memdbgon.h"

extern CGameConfig *g_GameConfig;

CMemPatch g_CommonPatches[] =
{

#ifndef _WIN32
// Linux checks for the nav mesh in each bot_add command, so we patch 3 times

#endif
};

CMemPatch g_ClientPatches[] =
{
//CMemPatch("ClientMovementUnlock", "ClientMovementUnlock"),
};

#ifdef _WIN32
CMemPatch g_ToolsPatches[] =
{
// Remove some -nocustomermachine checks without needing -nocustomermachine itself
// as it can break stuff like the asset browser. This is mainly to enable device selection in compiles
// And yes, it's the exact same signature appearing 4 times, each unhides a certain hammer compile option

};
#endif


bool InitPatches(CGameConfig *g_GameConfig)
{
bool success = true;
for (int i = 0; i < sizeof(g_CommonPatches) / sizeof(*g_CommonPatches); i++)
{
if (!g_CommonPatches[i].PerformPatch(g_GameConfig))
success = false;
}

// Dedicated servers don't load client
if (!CommandLine()->HasParm("-dedicated"))
{
for (int i = 0; i < sizeof(g_ClientPatches) / sizeof(*g_ClientPatches); i++)
{
if (!g_ClientPatches[i].PerformPatch(g_GameConfig))
success = false;
}
}

#ifdef _WIN32
// None of the tools are loaded without, well, -tools
if (CommandLine()->HasParm("-tools"))
for (int i = 0; i < sizeof(g_ToolsPatches) / sizeof(*g_ToolsPatches); i++)
g_ToolsPatches[i].PerformPatch(g_GameConfig);
#endif
return success;
}

void UndoPatches()
{
for (int i = 0; i < sizeof(g_CommonPatches) / sizeof(*g_CommonPatches); i++)
g_CommonPatches[i].UndoPatch();

if (!CommandLine()->HasParm("-dedicated"))
{
for (int i = 0; i < sizeof(g_ClientPatches) / sizeof(*g_ClientPatches); i++)
g_ClientPatches[i].UndoPatch();
}

#ifdef _WIN32
if (CommandLine()->HasParm("-tools"))
{
for (int i = 0; i < sizeof(g_ToolsPatches) / sizeof(*g_ToolsPatches); i++)
g_ToolsPatches[i].UndoPatch();
}
#endif
}

0 comments on commit ea870b8

Please sign in to comment.