Fix Formatting C:

This commit is contained in:
zaCade 2024-05-23 13:11:22 +02:00
parent aaad26e257
commit 2cc7803f40
6 changed files with 29 additions and 30 deletions

View File

@ -2,7 +2,7 @@
import os
if not "SM" in globals():
SM = Extension
SM = Extension
projectName = 'CSSFixes'

View File

@ -230,4 +230,3 @@ default: all
clean: check
rm -rf $(BIN_DIR)/*.o
rm -rf $(BIN_DIR)/$(BINARY)

View File

@ -7,7 +7,7 @@ from ambuild2 import run
builder = run.PrepareBuild(sourcePath = sys.path[0])
builder.options.add_option('--hl2sdk-root', type=str, dest='hl2sdk_root', default=None,
help='Root search folder for HL2SDKs')
help='Root search folder for HL2SDKs')
builder.options.add_option('--mms-path', type=str, dest='mms_path', default=None,
help='Path to Metamod:Source')
builder.options.add_option('--sm-path', type=str, dest='sm_path', default=None,

View File

@ -258,7 +258,7 @@ static struct SrcdsPatch
(unsigned char *)"\xEB\x23\x89\xD0\x25\x00\x00\x00\x00\xC1\xE0\x04",
"cstrike/bin/server_srv.so"
},
// 14: CGameMovement::LadderMove NOP out player->SetGravity( 0 );
// 14: CGameMovement::LadderMove NOP out player->SetGravity( 0 );
{
"_ZN13CGameMovement10LadderMoveEv",
(unsigned char *)"\xC7\x80\x78\x02\x00\x00\x00\x00\x00\x00",
@ -267,13 +267,13 @@ static struct SrcdsPatch
"cstrike/bin/server_srv.so"
},
// 15: I CUtlLinkedList<T,S,ML,I,M>::AllocInternal( bool multilist )
//skip CUtlLinkedList overflow! (exhausted memory allocator) and CUtlLinkedList overflow! (exhausted index range)
//this avoids crashing when loading over 64k strings into stringpool. Custom assets in maps lead towards the limit. jenz- December 2023
// \x90 prevent green,
// \xEB prevent red
/*
{
// 15: I CUtlLinkedList<T,S,ML,I,M>::AllocInternal( bool multilist )
//skip CUtlLinkedList overflow! (exhausted memory allocator) and CUtlLinkedList overflow! (exhausted index range)
//this avoids crashing when loading over 64k strings into stringpool. Custom assets in maps lead towards the limit. jenz- December 2023
// \x90 prevent green,
// \xEB prevent red
/*
{
"_ZN14CUtlLinkedListI16CUtlKeyValuePairI19CUtlConstStringBaseIcE7empty_tEtLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS4_tEtEE13AllocInternalEb",
(unsigned char *)"\x74\x0C",
"xx",
@ -298,7 +298,7 @@ static struct SrcdsPatch
"bin/dedicated_srv.so"
},
*/
*/
};
class CBaseEntity;
@ -488,7 +488,7 @@ DETOUR_DECL_MEMBER2(DETOUR_KeyValue, bool, const char *, szKeyName, const char *
{
VPROF_ENTER_SCOPE("CSSFixes::DETOUR_KeyValue");
CBaseEntity *pEntity = (CBaseEntity *)this;
CBaseEntity *pEntity = (CBaseEntity *)this;
// Fix crash bug in engine
if(strcasecmp(szKeyName, "angle") == 0)
@ -509,9 +509,9 @@ DETOUR_DECL_MEMBER2(DETOUR_KeyValue, bool, const char *, szKeyName, const char *
if(pClassname && strcasecmp(pClassname, "func_buyzone") == 0)
szValue = "3";
}
else if(strcasecmp(szKeyName, "absvelocity") == 0)
{
static int m_AbsVelocity_offset = 0;
else if(strcasecmp(szKeyName, "absvelocity") == 0)
{
static int m_AbsVelocity_offset = 0;
if (!m_AbsVelocity_offset)
{
@ -527,7 +527,7 @@ DETOUR_DECL_MEMBER2(DETOUR_KeyValue, bool, const char *, szKeyName, const char *
Vector *vecAbsVelocity = (Vector*)((uint8_t*)pEntity + m_AbsVelocity_offset);
vecAbsVelocity->Init(tmp[0], tmp[1], tmp[2]);
}
}
bool bHandled = DETOUR_MEMBER_CALL(DETOUR_KeyValue)(szKeyName, szValue);
@ -696,7 +696,7 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
{
srand((unsigned int)time(NULL));
g_iMaxPlayers = playerhelpers->GetMaxClients();
g_iMaxPlayers = playerhelpers->GetMaxClients();
char conf_error[255] = "";
if(!gameconfs->LoadGameConfigFile("CSSFixes", &g_pGameConf, conf_error, sizeof(conf_error)))
@ -889,7 +889,7 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
if(found)
break;
snprintf(error, maxlength, "Could not find patch signature for symbol: %s", pPatch->pSignature);
snprintf(error, maxlength, "Could not find patch signature for symbol: %s", pPatch->pSignature);
SDK_OnUnload();
return false;
}