Compare commits

...
7 Commits
2 changed files with 49 additions and 53 deletions
+43 -53
View File
@@ -262,64 +262,28 @@ static struct SrcdsPatch
}, },
// 14: CGameMovement::LadderMove NOP out player->SetGravity( 0 ); // 14: CGameMovement::LadderMove NOP out player->SetGravity( 0 );
// This is in a cloned function which has a weird symbol (_ZN13CGameMovement10LadderMoveEv_part_0) so I went with the function right before it // This is in a cloned function which has a weird symbol (_ZN13CGameMovement10LadderMoveEv_part_0) so I went with the function right before it
{
"_ZN13CGameMovement12CheckFallingEv",
(unsigned char *)"\xC7\x80\xA4\x02\x00\x00\x00\x00\x00\x00\x8B\x03\x8B\x80",
"xx????????xxxx",
(unsigned char *)"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x8B\x03\x8B\x80",
"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
/*
{
"_ZN14CUtlLinkedListI16CUtlKeyValuePairI19CUtlConstStringBaseIcE7empty_tEtLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS4_tEtEE13AllocInternalEb",
(unsigned char *)"\x74\x0C",
"xx",
(unsigned char *)"\x90\x90",
"bin/dedicated_srv.so"
},
{
"_ZN12CZipPackFile7PrepareExx",
(unsigned char *)"\x0F\x85\x32\x03\x00\x00",
"_ZN14CUtlLinkedListI16CUtlKeyValuePairI19CUtlConstStringBaseIcE7empty_tEtLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS4_tEtEE13AllocInternalEb",
(unsigned char *)"\x0F\x87\x7A\xFF\xFF\xFF",
"xxxxxx",
(unsigned char *)"\xEB\x85\x32\x03\x00\x00" ,
(unsigned char *)"\xEB\x87\x7A\xFF\xFF\xFF",
"bin/dedicated_srv.so"
},
{
"_ZN14CUtlLinkedListI16CUtlKeyValuePairI19CUtlConstStringBaseIcE7empty_tEtLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS4_tEtEE13AllocInternalEb",
(unsigned char *)"\x0F\x84\x9C\x00\x00\x00",
"xxxxxx",
(unsigned char *)"\x90\x90\x90\x90\x90\x90",
"bin/dedicated_srv.so"
},
*/
// 16: should allow people to run around freely after game end, by overwriting pPlayer->AddFlag( FL_FROZEN ); line 3337 in cs_gamerules.cpp
//this change is desired for the new mapvoting feature so that people can still freely move at the end of the map while the vote is running.
{ {
"_ZN12CCSGameRules16GoToIntermissionEv", "_ZN13CGameMovement12CheckFallingEv",
(unsigned char *)"\x74\x0E\x83\xEC\x08\x6A\x40\x50", (unsigned char *)"\xC7\x86\xA4\x02\x00\x00\x00\x00\x00\x00\xE9\x00\xFF\xFF",
"xxxxxxxx", "xx????????x???",
(unsigned char *)"\xEB\x0E\x83\xEC\x08\x6A\x40\x50", (unsigned char *)"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\xE9\x00\xFF\xFF",
"cstrike/bin/server_srv.so" "cstrike/bin/server_srv.so",
0x600
}, },
//17 also jump over boolean = true // freeze players while in intermission m_bFreezePeriod = true;
// 15: bool CZipPackFile::Prepare( int64 fileLen, int64 nFileOfs )
//NOPs out lookup.m_hFileName = m_fs->FindOrAddFileName( tmpString ); Line 768
//stop the errors CUtlLinkedList overflow! (exhausted memory allocator) and CUtlLinkedList overflow! (exhausted index range)
//this avoids crashing due to loading over 65k strings into stringpool. Custom assets in maps lead towards the limit. jenz- December 2023
{ {
"_ZN12CCSGameRules16GoToIntermissionEv", "_ZN12CZipPackFile7PrepareExx",
(unsigned char *)"\x75\x0F\xE8\x69\xCE\xDA\xFF\x8B\x45\x08", (unsigned char *)"\x8B\x10\x57\x50\xFF\x92\x8C\x00\x00\x00",
"xxxxxxxxxx", "xxxxxxxxxx",
(unsigned char *)"\xEB\x0F\xE8\x69\xCE\xDA\xFF\x8B\x45\x08", (unsigned char *)"\x8B\x10\x57\x50\x31\xC0\x90\x90\x90\x90",
"cstrike/bin/server_srv.so" "bin/dedicated_srv.so",
0x600
}, },
// 18: Remove weird filename handle check in CZipPackFile::GetFileInfo that broke loading mixed case files in bsp pakfiles // 16: Remove weird filename handle check in CZipPackFile::GetFileInfo that broke loading mixed case files in bsp pakfiles
{ {
"_ZN12CZipPackFile11GetFileInfoEPKcRiRxS2_S2_Rt", "_ZN12CZipPackFile11GetFileInfoEPKcRiRxS2_S2_Rt",
(unsigned char *)"\x75\x00\x8B\x09", (unsigned char *)"\x75\x00\x8B\x09",
@@ -378,6 +342,8 @@ CDetour *g_pDetour_CTraceFilterSimple = NULL;
CDetour *g_pDetour_KeyValue = NULL; CDetour *g_pDetour_KeyValue = NULL;
CDetour *g_pDetour_FireBullets = NULL; CDetour *g_pDetour_FireBullets = NULL;
CDetour *g_pDetour_SwingOrStab = NULL; CDetour *g_pDetour_SwingOrStab = NULL;
CDetour *g_pDetour_UTIL_DecalTrace = NULL;
int g_SH_SkipTwoEntitiesShouldHitEntity = 0; int g_SH_SkipTwoEntitiesShouldHitEntity = 0;
int g_SH_SimpleShouldHitEntity = 0; int g_SH_SimpleShouldHitEntity = 0;
@@ -583,6 +549,15 @@ DETOUR_DECL_MEMBER3(DETOUR_CTraceFilterSimple, void, const IHandleEntity *, pass
*(uintptr_t *)this = g_CTraceFilterNoNPCsOrPlayer; *(uintptr_t *)this = g_CTraceFilterNoNPCsOrPlayer;
} }
DETOUR_DECL_STATIC2(DETOUR_UTIL_DecalTrace, void, void *, pTrace, char *, decalName)
{
// to stop grenades from causing "Too many indices for index buffer. Tell a programmer". Grenades cause decals on too many faces for the client to handle.
if (strcmp(decalName, "Scorch") == 0)
return;
DETOUR_STATIC_CALL(DETOUR_UTIL_DecalTrace)(pTrace, decalName);
}
/* Make bullets ignore teammates */ /* Make bullets ignore teammates */
char *g_pPhysboxToClientMap = NULL; char *g_pPhysboxToClientMap = NULL;
bool g_InFireBullets = false; bool g_InFireBullets = false;
@@ -809,6 +784,14 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
return false; return false;
} }
g_pDetour_UTIL_DecalTrace = DETOUR_CREATE_STATIC(DETOUR_UTIL_DecalTrace, "UTIL_DecalTrace");
if (g_pDetour_UTIL_DecalTrace == NULL)
{
snprintf(error, maxlength, "Could not create detour for UTIL_DecalTrace");
SDK_OnUnload();
return false;
}
g_pDetour_InputTestActivator->EnableDetour(); g_pDetour_InputTestActivator->EnableDetour();
g_pDetour_PostConstructor->EnableDetour(); g_pDetour_PostConstructor->EnableDetour();
g_pDetour_CreateEntityByName->EnableDetour(); g_pDetour_CreateEntityByName->EnableDetour();
@@ -818,6 +801,7 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
g_pDetour_KeyValue->EnableDetour(); g_pDetour_KeyValue->EnableDetour();
g_pDetour_FireBullets->EnableDetour(); g_pDetour_FireBullets->EnableDetour();
g_pDetour_SwingOrStab->EnableDetour(); g_pDetour_SwingOrStab->EnableDetour();
g_pDetour_UTIL_DecalTrace->EnableDetour();
// Find VTable for CTraceFilterSkipTwoEntities // Find VTable for CTraceFilterSkipTwoEntities
uintptr_t pCTraceFilterSkipTwoEntities; uintptr_t pCTraceFilterSkipTwoEntities;
@@ -1020,6 +1004,12 @@ void CSSFixes::SDK_OnUnload()
g_pDetour_SwingOrStab = NULL; g_pDetour_SwingOrStab = NULL;
} }
if (g_pDetour_UTIL_DecalTrace != NULL)
{
g_pDetour_UTIL_DecalTrace->Destroy();
g_pDetour_UTIL_DecalTrace = NULL;
}
if(g_SH_SkipTwoEntitiesShouldHitEntity) if(g_SH_SkipTwoEntitiesShouldHitEntity)
SH_REMOVE_HOOK_ID(g_SH_SkipTwoEntitiesShouldHitEntity); SH_REMOVE_HOOK_ID(g_SH_SkipTwoEntitiesShouldHitEntity);
+6
View File
@@ -81,6 +81,12 @@
"library" "server" "library" "server"
"linux" "@_ZN6CKnife11SwingOrStabEb" "linux" "@_ZN6CKnife11SwingOrStabEb"
} }
"UTIL_DecalTrace"
{
"library" "server"
"linux" "@_Z15UTIL_DecalTraceP10CGameTracePKc"
}
} }
} }
} }