forked from CSSZombieEscape/sm-ext-CSSFixes
fixes/update from xen
This commit is contained in:
parent
b42029c1fc
commit
8ce27ab481
@ -189,10 +189,11 @@ static struct SrcdsPatch
|
|||||||
// 6: disable player->m_takedamage = DAMAGE_NO in point_viewcontrol->Enable
|
// 6: disable player->m_takedamage = DAMAGE_NO in point_viewcontrol->Enable
|
||||||
{
|
{
|
||||||
"_ZN14CTriggerCamera6EnableEv",
|
"_ZN14CTriggerCamera6EnableEv",
|
||||||
(unsigned char *)"\x31\xF6\x80\xBE\xFD\x00\x00\x00\x00\x0F\x85\x8D\x03\x00\x00",
|
(unsigned char *)"\xC6\x86\x00\x00\x00\x00\x00\x8B\x83\x00\x00\x00\x00\xA8\x20",
|
||||||
"xxxx?xxxxxx??xx",
|
"xx?????xx????xx",
|
||||||
(unsigned char *)"\x31\xF6\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90",
|
(unsigned char *)"\x90\x90\x90\x90\x90\x90\x90\x8B\x83\x00\x00\x00\x00\xA8\x20",
|
||||||
"cstrike/bin/server_srv.so"
|
"cstrike/bin/server_srv.so",
|
||||||
|
0x600
|
||||||
},
|
},
|
||||||
// 7: disable player->m_takedamage = m_nOldTakeDamage in point_viewcontrol->Disable
|
// 7: disable player->m_takedamage = m_nOldTakeDamage in point_viewcontrol->Disable
|
||||||
{
|
{
|
||||||
@ -299,21 +300,50 @@ DETOUR_DECL_MEMBER1(DETOUR_InputTestActivator, void, inputdata_t *, inputdata)
|
|||||||
DETOUR_MEMBER_CALL(DETOUR_InputTestActivator)(inputdata);
|
DETOUR_MEMBER_CALL(DETOUR_InputTestActivator)(inputdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *pszNonEdicts[] =
|
||||||
|
{
|
||||||
|
"ambient_generic",
|
||||||
|
"game_score",
|
||||||
|
"game_text",
|
||||||
|
"game_ui",
|
||||||
|
"logic_auto", // bruh
|
||||||
|
"phys_thruster",
|
||||||
|
"phys_keepupright",
|
||||||
|
"player_speedmod",
|
||||||
|
"player_weaponstrip",
|
||||||
|
"point_clientcommand",
|
||||||
|
"point_servercommand",
|
||||||
|
"point_teleport",
|
||||||
|
};
|
||||||
|
|
||||||
DETOUR_DECL_MEMBER1(DETOUR_PostConstructor, void, const char *, szClassname)
|
DETOUR_DECL_MEMBER1(DETOUR_PostConstructor, void, const char *, szClassname)
|
||||||
{
|
{
|
||||||
if(strncasecmp(szClassname, "info_player_", 12) == 0)
|
|
||||||
{
|
|
||||||
CBaseEntity *pEntity = (CBaseEntity *)this;
|
CBaseEntity *pEntity = (CBaseEntity *)this;
|
||||||
|
|
||||||
datamap_t *pMap = gamehelpers->GetDataMap(pEntity);
|
static datamap_t *pMap = gamehelpers->GetDataMap(pEntity);
|
||||||
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];
|
||||||
|
|
||||||
|
if(strncasecmp(szClassname, "info_player_", 12) == 0)
|
||||||
|
{
|
||||||
// Spawnpoints don't need edicts...
|
// Spawnpoints don't need edicts...
|
||||||
*(uint32 *)((intptr_t)pEntity + td->fieldOffset[TD_OFFSET_NORMAL]) |= (1<<9); // EFL_SERVER_ONLY
|
*(uint32 *)((intptr_t)pEntity + offset) |= (1<<9); // EFL_SERVER_ONLY
|
||||||
|
|
||||||
// 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);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove edicts for a bunch of entities that REALLY don't need them
|
||||||
|
for (int i = 0; i < sizeof(pszNonEdicts)/sizeof(*pszNonEdicts); i++)
|
||||||
|
{
|
||||||
|
if (!strcasecmp(szClassname, pszNonEdicts[i]))
|
||||||
|
{
|
||||||
|
*(uint32 *)((intptr_t)pEntity + offset) |= (1<<9); // EFL_SERVER_ONLY
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DETOUR_MEMBER_CALL(DETOUR_PostConstructor)(szClassname);
|
DETOUR_MEMBER_CALL(DETOUR_PostConstructor)(szClassname);
|
||||||
|
Loading…
Reference in New Issue
Block a user