forked from CSSZombieEscape/sm-ext-CSSFixes
All spawnpoints are CT spawnpoints now, spawnpoints will only be selected from CT spawnpoints.
Only TerminateRound(GameCommencing) when both teams were empty. Fix crash on addoutput angle
This commit is contained in:
parent
7f56360ee9
commit
cc012e8ef7
@ -57,6 +57,20 @@ static struct SrcdsPatch
|
|||||||
"xxxxxxxxxxxxxx",
|
"xxxxxxxxxxxxxx",
|
||||||
(unsigned char *)"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90",
|
(unsigned char *)"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90",
|
||||||
0, 0, 0
|
0, 0, 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_ZN9CCSPlayer19EntSelectSpawnPointEv",
|
||||||
|
(unsigned char *)"\x89\x1C\x24\xE8\x00\x00\x00\x00\x83\xF8\x03\x74\x4B",
|
||||||
|
"xxxx????xxxxx",
|
||||||
|
(unsigned char *)"\x89\x1C\x24\x90\x90\x90\x90\x90\x90\x90\x90\xEB\x4B",
|
||||||
|
0, 0, 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_ZN12CCSGameRules18NeededPlayersCheckERb",
|
||||||
|
(unsigned char *)"\x74\x0E\x8B\x83\x80\x02\x00\x00\x85\xC0\x0F\x85\x9E\x00\x00\x00\xC7\x04\x24\xAC\xF7\x87\x00\xE8\xC2\x82\x91\x00",
|
||||||
|
"xxxxxxxxxxxxxxxx????????????",
|
||||||
|
(unsigned char *)"\x0F\x85\xA8\x00\x00\x00\x8B\x83\x80\x02\x00\x00\x85\xC0\x0F\x85\x9A\x00\x00\x00\x90\x90\x90\x90\x90\x90\x90\x90",
|
||||||
|
0, 0, 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -99,6 +113,7 @@ CDetour *detourFindUseEntity = NULL;
|
|||||||
CDetour *detourCTraceFilterSimple = NULL;
|
CDetour *detourCTraceFilterSimple = NULL;
|
||||||
CDetour *detourMultiWaitOver = NULL;
|
CDetour *detourMultiWaitOver = NULL;
|
||||||
CDetour *detourRunThinkFunctions = NULL;
|
CDetour *detourRunThinkFunctions = NULL;
|
||||||
|
CDetour *detourKeyValue = NULL;
|
||||||
|
|
||||||
DETOUR_DECL_MEMBER1(InputTestActivator, void, inputdata_t *, inputdata)
|
DETOUR_DECL_MEMBER1(InputTestActivator, void, inputdata_t *, inputdata)
|
||||||
{
|
{
|
||||||
@ -110,7 +125,7 @@ DETOUR_DECL_MEMBER1(InputTestActivator, void, inputdata_t *, inputdata)
|
|||||||
|
|
||||||
DETOUR_DECL_MEMBER1(PostConstructor, void, const char *, szClassname)
|
DETOUR_DECL_MEMBER1(PostConstructor, void, const char *, szClassname)
|
||||||
{
|
{
|
||||||
if(strncmp(szClassname, "info_player_", 12) == 0)
|
if(strncasecmp(szClassname, "info_player_", 12) == 0)
|
||||||
{
|
{
|
||||||
CBaseEntity *pEntity = (CBaseEntity *)this;
|
CBaseEntity *pEntity = (CBaseEntity *)this;
|
||||||
|
|
||||||
@ -118,11 +133,26 @@ DETOUR_DECL_MEMBER1(PostConstructor, void, const char *, szClassname)
|
|||||||
typedescription_t *td = gamehelpers->FindInDataMap(pMap, "m_iEFlags");
|
typedescription_t *td = gamehelpers->FindInDataMap(pMap, "m_iEFlags");
|
||||||
|
|
||||||
*(uint32 *)((intptr_t)pEntity + td->fieldOffset[TD_OFFSET_NORMAL]) |= (1<<9); // EFL_SERVER_ONLY
|
*(uint32 *)((intptr_t)pEntity + td->fieldOffset[TD_OFFSET_NORMAL]) |= (1<<9); // EFL_SERVER_ONLY
|
||||||
|
szClassname = "info_player_counterterrorist";
|
||||||
}
|
}
|
||||||
|
|
||||||
DETOUR_MEMBER_CALL(PostConstructor)(szClassname);
|
DETOUR_MEMBER_CALL(PostConstructor)(szClassname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DETOUR_DECL_MEMBER2(KeyValue, bool, const char *, szKeyName, const char *, szValue)
|
||||||
|
{
|
||||||
|
if(strcasecmp(szKeyName, "angle") == 0)
|
||||||
|
szKeyName = "angles";
|
||||||
|
|
||||||
|
else if(strcasecmp(szKeyName, "classname") == 0 &&
|
||||||
|
strncasecmp(szValue, "info_player_", 12) == 0)
|
||||||
|
{
|
||||||
|
szValue = "info_player_counterterrorist";
|
||||||
|
}
|
||||||
|
|
||||||
|
return DETOUR_MEMBER_CALL(KeyValue)(szKeyName, szValue);
|
||||||
|
}
|
||||||
|
|
||||||
volatile bool gv_InFindUseEntity = false;
|
volatile bool gv_InFindUseEntity = false;
|
||||||
DETOUR_DECL_MEMBER0(FindUseEntity, CBaseEntity *)
|
DETOUR_DECL_MEMBER0(FindUseEntity, CBaseEntity *)
|
||||||
{
|
{
|
||||||
@ -226,12 +256,21 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
detourKeyValue = DETOUR_CREATE_MEMBER(KeyValue, "CBaseEntity_KeyValue");
|
||||||
|
if(detourKeyValue == NULL)
|
||||||
|
{
|
||||||
|
snprintf(error, maxlength, "Could not create detour for CBaseEntity_KeyValue");
|
||||||
|
SDK_OnUnload();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
detourInputTestActivator->EnableDetour();
|
detourInputTestActivator->EnableDetour();
|
||||||
detourPostConstructor->EnableDetour();
|
detourPostConstructor->EnableDetour();
|
||||||
detourFindUseEntity->EnableDetour();
|
detourFindUseEntity->EnableDetour();
|
||||||
detourCTraceFilterSimple->EnableDetour();
|
detourCTraceFilterSimple->EnableDetour();
|
||||||
detourMultiWaitOver->EnableDetour();
|
detourMultiWaitOver->EnableDetour();
|
||||||
detourRunThinkFunctions->EnableDetour();
|
detourRunThinkFunctions->EnableDetour();
|
||||||
|
detourKeyValue->EnableDetour();
|
||||||
|
|
||||||
// Find VTable for CTraceFilterNoNPCsOrPlayer
|
// Find VTable for CTraceFilterNoNPCsOrPlayer
|
||||||
uintptr_t pCTraceFilterNoNPCsOrPlayer;
|
uintptr_t pCTraceFilterNoNPCsOrPlayer;
|
||||||
@ -333,6 +372,12 @@ void CSSFixes::SDK_OnUnload()
|
|||||||
detourRunThinkFunctions = NULL;
|
detourRunThinkFunctions = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(detourKeyValue != NULL)
|
||||||
|
{
|
||||||
|
detourKeyValue->Destroy();
|
||||||
|
detourKeyValue = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if(g_pOnRunThinkFunctions != NULL)
|
if(g_pOnRunThinkFunctions != NULL)
|
||||||
{
|
{
|
||||||
forwards->ReleaseForward(g_pOnRunThinkFunctions);
|
forwards->ReleaseForward(g_pOnRunThinkFunctions);
|
||||||
|
@ -45,6 +45,12 @@
|
|||||||
"library" "server"
|
"library" "server"
|
||||||
"linux" "@_Z25Physics_RunThinkFunctionsb"
|
"linux" "@_Z25Physics_RunThinkFunctionsb"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"CBaseEntity_KeyValue"
|
||||||
|
{
|
||||||
|
"library" "server"
|
||||||
|
"linux" "@_ZN11CBaseEntity8KeyValueEPKcS1_"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
/* Basic information exposed publicly */
|
/* Basic information exposed publicly */
|
||||||
#define SMEXT_CONF_NAME "CSSFixes"
|
#define SMEXT_CONF_NAME "CSSFixes"
|
||||||
#define SMEXT_CONF_DESCRIPTION "Patches bugs in the CSS server binary."
|
#define SMEXT_CONF_DESCRIPTION "Patches bugs in the CSS server binary."
|
||||||
#define SMEXT_CONF_VERSION "1.3"
|
#define SMEXT_CONF_VERSION "1.4"
|
||||||
#define SMEXT_CONF_AUTHOR "BotoX"
|
#define SMEXT_CONF_AUTHOR "BotoX"
|
||||||
#define SMEXT_CONF_URL ""
|
#define SMEXT_CONF_URL ""
|
||||||
#define SMEXT_CONF_LOGTAG "CSSFIXES"
|
#define SMEXT_CONF_LOGTAG "CSSFIXES"
|
||||||
|
Loading…
Reference in New Issue
Block a user