Fix Formatting C:
This commit is contained in:
parent
aaad26e257
commit
2cc7803f40
@ -2,7 +2,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
if not "SM" in globals():
|
if not "SM" in globals():
|
||||||
SM = Extension
|
SM = Extension
|
||||||
|
|
||||||
projectName = 'CSSFixes'
|
projectName = 'CSSFixes'
|
||||||
|
|
||||||
|
3
Makefile
3
Makefile
@ -120,7 +120,7 @@ ifeq "$(USEMETA)" "true"
|
|||||||
LINK += $(LINK_HL2)
|
LINK += $(LINK_HL2)
|
||||||
|
|
||||||
INCLUDE += -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) \
|
INCLUDE += -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) \
|
||||||
-I$(METAMOD)/sourcehook
|
-I$(METAMOD)/sourcehook
|
||||||
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_BLOODYGOODTIME=4 -DSE_EYE=5 \
|
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_BLOODYGOODTIME=4 -DSE_EYE=5 \
|
||||||
-DSE_CSS=6 -DSE_ORANGEBOXVALVE=7 -DSE_LEFT4DEAD=8 -DSE_LEFT4DEAD2=9 -DSE_ALIENSWARM=10 \
|
-DSE_CSS=6 -DSE_ORANGEBOXVALVE=7 -DSE_LEFT4DEAD=8 -DSE_LEFT4DEAD2=9 -DSE_ALIENSWARM=10 \
|
||||||
-DSE_PORTAL2=11 -DSE_CSGO=12
|
-DSE_PORTAL2=11 -DSE_CSGO=12
|
||||||
@ -230,4 +230,3 @@ default: all
|
|||||||
clean: check
|
clean: check
|
||||||
rm -rf $(BIN_DIR)/*.o
|
rm -rf $(BIN_DIR)/*.o
|
||||||
rm -rf $(BIN_DIR)/$(BINARY)
|
rm -rf $(BIN_DIR)/$(BINARY)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ from ambuild2 import run
|
|||||||
builder = run.PrepareBuild(sourcePath = sys.path[0])
|
builder = run.PrepareBuild(sourcePath = sys.path[0])
|
||||||
|
|
||||||
builder.options.add_option('--hl2sdk-root', type=str, dest='hl2sdk_root', default=None,
|
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,
|
builder.options.add_option('--mms-path', type=str, dest='mms_path', default=None,
|
||||||
help='Path to Metamod:Source')
|
help='Path to Metamod:Source')
|
||||||
builder.options.add_option('--sm-path', type=str, dest='sm_path', default=None,
|
builder.options.add_option('--sm-path', type=str, dest='sm_path', default=None,
|
||||||
|
@ -258,7 +258,7 @@ static struct SrcdsPatch
|
|||||||
(unsigned char *)"\xEB\x23\x89\xD0\x25\x00\x00\x00\x00\xC1\xE0\x04",
|
(unsigned char *)"\xEB\x23\x89\xD0\x25\x00\x00\x00\x00\xC1\xE0\x04",
|
||||||
"cstrike/bin/server_srv.so"
|
"cstrike/bin/server_srv.so"
|
||||||
},
|
},
|
||||||
// 14: CGameMovement::LadderMove NOP out player->SetGravity( 0 );
|
// 14: CGameMovement::LadderMove NOP out player->SetGravity( 0 );
|
||||||
{
|
{
|
||||||
"_ZN13CGameMovement10LadderMoveEv",
|
"_ZN13CGameMovement10LadderMoveEv",
|
||||||
(unsigned char *)"\xC7\x80\x78\x02\x00\x00\x00\x00\x00\x00",
|
(unsigned char *)"\xC7\x80\x78\x02\x00\x00\x00\x00\x00\x00",
|
||||||
@ -267,13 +267,13 @@ static struct SrcdsPatch
|
|||||||
"cstrike/bin/server_srv.so"
|
"cstrike/bin/server_srv.so"
|
||||||
},
|
},
|
||||||
|
|
||||||
// 15: I CUtlLinkedList<T,S,ML,I,M>::AllocInternal( bool multilist )
|
// 15: I CUtlLinkedList<T,S,ML,I,M>::AllocInternal( bool multilist )
|
||||||
//skip CUtlLinkedList overflow! (exhausted memory allocator) and CUtlLinkedList overflow! (exhausted index range)
|
//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
|
//this avoids crashing when loading over 64k strings into stringpool. Custom assets in maps lead towards the limit. jenz- December 2023
|
||||||
// \x90 prevent green,
|
// \x90 prevent green,
|
||||||
// \xEB prevent red
|
// \xEB prevent red
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
"_ZN14CUtlLinkedListI16CUtlKeyValuePairI19CUtlConstStringBaseIcE7empty_tEtLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS4_tEtEE13AllocInternalEb",
|
"_ZN14CUtlLinkedListI16CUtlKeyValuePairI19CUtlConstStringBaseIcE7empty_tEtLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS4_tEtEE13AllocInternalEb",
|
||||||
(unsigned char *)"\x74\x0C",
|
(unsigned char *)"\x74\x0C",
|
||||||
"xx",
|
"xx",
|
||||||
@ -298,7 +298,7 @@ static struct SrcdsPatch
|
|||||||
"bin/dedicated_srv.so"
|
"bin/dedicated_srv.so"
|
||||||
},
|
},
|
||||||
|
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBaseEntity;
|
class CBaseEntity;
|
||||||
@ -368,7 +368,7 @@ DETOUR_DECL_MEMBER1(DETOUR_InputTestActivator, void, inputdata_t *, inputdata)
|
|||||||
DETOUR_MEMBER_CALL(DETOUR_InputTestActivator)(inputdata);
|
DETOUR_MEMBER_CALL(DETOUR_InputTestActivator)(inputdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *pszNonEdicts[] =
|
const char *pszNonEdicts[] =
|
||||||
{
|
{
|
||||||
"game_score",
|
"game_score",
|
||||||
"game_text",
|
"game_text",
|
||||||
@ -388,11 +388,11 @@ DETOUR_DECL_MEMBER1(DETOUR_PostConstructor, void, const char *, szClassname)
|
|||||||
VPROF_ENTER_SCOPE("CSSFixes::DETOUR_PostConstructor");
|
VPROF_ENTER_SCOPE("CSSFixes::DETOUR_PostConstructor");
|
||||||
|
|
||||||
CBaseEntity *pEntity = (CBaseEntity *)this;
|
CBaseEntity *pEntity = (CBaseEntity *)this;
|
||||||
|
|
||||||
static datamap_t *pMap = gamehelpers->GetDataMap(pEntity);
|
static datamap_t *pMap = gamehelpers->GetDataMap(pEntity);
|
||||||
static typedescription_t *td = gamehelpers->FindInDataMap(pMap, "m_iEFlags");
|
static typedescription_t *td = gamehelpers->FindInDataMap(pMap, "m_iEFlags");
|
||||||
static uint32 offset = td->fieldOffset[TD_OFFSET_NORMAL];
|
static uint32 offset = td->fieldOffset[TD_OFFSET_NORMAL];
|
||||||
|
|
||||||
if(strncasecmp(szClassname, "info_player_", 12) == 0)
|
if(strncasecmp(szClassname, "info_player_", 12) == 0)
|
||||||
{
|
{
|
||||||
// Spawnpoints don't need edicts...
|
// Spawnpoints don't need edicts...
|
||||||
@ -401,11 +401,11 @@ DETOUR_DECL_MEMBER1(DETOUR_PostConstructor, void, const char *, szClassname)
|
|||||||
// Only CT spawnpoints
|
// Only CT spawnpoints
|
||||||
if(strcasecmp(szClassname, "info_player_terrorist") == 0)
|
if(strcasecmp(szClassname, "info_player_terrorist") == 0)
|
||||||
szClassname = "info_player_counterterrorist";
|
szClassname = "info_player_counterterrorist";
|
||||||
|
|
||||||
DETOUR_MEMBER_CALL(DETOUR_PostConstructor)(szClassname);
|
DETOUR_MEMBER_CALL(DETOUR_PostConstructor)(szClassname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove edicts for a bunch of entities that REALLY don't need them
|
// Remove edicts for a bunch of entities that REALLY don't need them
|
||||||
for (int i = 0; i < sizeof(pszNonEdicts)/sizeof(*pszNonEdicts); i++)
|
for (int i = 0; i < sizeof(pszNonEdicts)/sizeof(*pszNonEdicts); i++)
|
||||||
{
|
{
|
||||||
@ -416,7 +416,7 @@ DETOUR_DECL_MEMBER1(DETOUR_PostConstructor, void, const char *, szClassname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DETOUR_MEMBER_CALL(DETOUR_PostConstructor)(szClassname);
|
DETOUR_MEMBER_CALL(DETOUR_PostConstructor)(szClassname);
|
||||||
|
|
||||||
VPROF_EXIT_SCOPE();
|
VPROF_EXIT_SCOPE();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ DETOUR_DECL_MEMBER2(DETOUR_KeyValue, bool, const char *, szKeyName, const char *
|
|||||||
{
|
{
|
||||||
VPROF_ENTER_SCOPE("CSSFixes::DETOUR_KeyValue");
|
VPROF_ENTER_SCOPE("CSSFixes::DETOUR_KeyValue");
|
||||||
|
|
||||||
CBaseEntity *pEntity = (CBaseEntity *)this;
|
CBaseEntity *pEntity = (CBaseEntity *)this;
|
||||||
|
|
||||||
// Fix crash bug in engine
|
// Fix crash bug in engine
|
||||||
if(strcasecmp(szKeyName, "angle") == 0)
|
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)
|
if(pClassname && strcasecmp(pClassname, "func_buyzone") == 0)
|
||||||
szValue = "3";
|
szValue = "3";
|
||||||
}
|
}
|
||||||
else if(strcasecmp(szKeyName, "absvelocity") == 0)
|
else if(strcasecmp(szKeyName, "absvelocity") == 0)
|
||||||
{
|
{
|
||||||
static int m_AbsVelocity_offset = 0;
|
static int m_AbsVelocity_offset = 0;
|
||||||
|
|
||||||
if (!m_AbsVelocity_offset)
|
if (!m_AbsVelocity_offset)
|
||||||
{
|
{
|
||||||
@ -527,10 +527,10 @@ DETOUR_DECL_MEMBER2(DETOUR_KeyValue, bool, const char *, szKeyName, const char *
|
|||||||
|
|
||||||
Vector *vecAbsVelocity = (Vector*)((uint8_t*)pEntity + m_AbsVelocity_offset);
|
Vector *vecAbsVelocity = (Vector*)((uint8_t*)pEntity + m_AbsVelocity_offset);
|
||||||
vecAbsVelocity->Init(tmp[0], tmp[1], tmp[2]);
|
vecAbsVelocity->Init(tmp[0], tmp[1], tmp[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bHandled = DETOUR_MEMBER_CALL(DETOUR_KeyValue)(szKeyName, szValue);
|
bool bHandled = DETOUR_MEMBER_CALL(DETOUR_KeyValue)(szKeyName, szValue);
|
||||||
|
|
||||||
VPROF_EXIT_SCOPE();
|
VPROF_EXIT_SCOPE();
|
||||||
|
|
||||||
return bHandled;
|
return bHandled;
|
||||||
@ -696,7 +696,7 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
{
|
{
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
|
|
||||||
g_iMaxPlayers = playerhelpers->GetMaxClients();
|
g_iMaxPlayers = playerhelpers->GetMaxClients();
|
||||||
|
|
||||||
char conf_error[255] = "";
|
char conf_error[255] = "";
|
||||||
if(!gameconfs->LoadGameConfigFile("CSSFixes", &g_pGameConf, conf_error, sizeof(conf_error)))
|
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)
|
if(found)
|
||||||
break;
|
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();
|
SDK_OnUnload();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* This program is free software; you can redistribute it and/or modify it under
|
* 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
|
* the terms of the GNU General Public License, version 3.0, as published by the
|
||||||
* Free Software Foundation.
|
* Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
* 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
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"library" "server"
|
"library" "server"
|
||||||
"linux" "@_ZN11CBaseEntity15PostConstructorEPKc"
|
"linux" "@_ZN11CBaseEntity15PostConstructorEPKc"
|
||||||
}
|
}
|
||||||
|
|
||||||
"CBaseFilter_PassesFilterImpl"
|
"CBaseFilter_PassesFilterImpl"
|
||||||
{
|
{
|
||||||
"library" "server"
|
"library" "server"
|
||||||
|
Loading…
Reference in New Issue
Block a user