Make trigger_multiple run full physics code after every wait cycle to work around engine limitation.
This commit is contained in:
parent
fb39ae0f3c
commit
04b749e985
@ -94,6 +94,7 @@ CDetour *detourInputTestActivator = NULL;
|
|||||||
CDetour *detourPostConstructor = NULL;
|
CDetour *detourPostConstructor = NULL;
|
||||||
CDetour *detourFindUseEntity = NULL;
|
CDetour *detourFindUseEntity = NULL;
|
||||||
CDetour *detourCTraceFilterSimple = NULL;
|
CDetour *detourCTraceFilterSimple = NULL;
|
||||||
|
CDetour *detourMultiWaitOver = NULL;
|
||||||
|
|
||||||
DETOUR_DECL_MEMBER1(InputTestActivator, void, inputdata_t *, inputdata)
|
DETOUR_DECL_MEMBER1(InputTestActivator, void, inputdata_t *, inputdata)
|
||||||
{
|
{
|
||||||
@ -139,6 +140,16 @@ DETOUR_DECL_MEMBER3(CTraceFilterSimple, void, const IHandleEntity *, passedict,
|
|||||||
*(uintptr_t *)this = g_CTraceFilterNoNPCsOrPlayer;
|
*(uintptr_t *)this = g_CTraceFilterNoNPCsOrPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DETOUR_DECL_MEMBER0(MultiWaitOver, void)
|
||||||
|
{
|
||||||
|
CBaseEntity *pEntity = (CBaseEntity *)this;
|
||||||
|
edict_t *pEdict = gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pEntity));
|
||||||
|
if(pEdict)
|
||||||
|
engine->TriggerMoved(pEdict, true);
|
||||||
|
|
||||||
|
DETOUR_MEMBER_CALL(MultiWaitOver)();
|
||||||
|
}
|
||||||
|
|
||||||
bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||||
{
|
{
|
||||||
char conf_error[255] = "";
|
char conf_error[255] = "";
|
||||||
@ -184,6 +195,14 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
}
|
}
|
||||||
detourCTraceFilterSimple->EnableDetour();
|
detourCTraceFilterSimple->EnableDetour();
|
||||||
|
|
||||||
|
detourMultiWaitOver = DETOUR_CREATE_MEMBER(MultiWaitOver, "CTriggerMultiple_MultiWaitOver");
|
||||||
|
if(detourMultiWaitOver == NULL)
|
||||||
|
{
|
||||||
|
snprintf(error, maxlength, "Could not create detour for CTriggerMultiple_MultiWaitOver");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
detourMultiWaitOver->EnableDetour();
|
||||||
|
|
||||||
// Find VTable for CTraceFilterNoNPCsOrPlayer
|
// Find VTable for CTraceFilterNoNPCsOrPlayer
|
||||||
uintptr_t pCTraceFilterNoNPCsOrPlayer;
|
uintptr_t pCTraceFilterNoNPCsOrPlayer;
|
||||||
if(!g_pGameConf->GetMemSig("CTraceFilterNoNPCsOrPlayer", (void **)(&pCTraceFilterNoNPCsOrPlayer)) || !pCTraceFilterNoNPCsOrPlayer)
|
if(!g_pGameConf->GetMemSig("CTraceFilterNoNPCsOrPlayer", (void **)(&pCTraceFilterNoNPCsOrPlayer)) || !pCTraceFilterNoNPCsOrPlayer)
|
||||||
@ -268,6 +287,12 @@ void CSSFixes::SDK_OnUnload()
|
|||||||
detourCTraceFilterSimple = NULL;
|
detourCTraceFilterSimple = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(detourMultiWaitOver != NULL)
|
||||||
|
{
|
||||||
|
detourMultiWaitOver->Destroy();
|
||||||
|
detourMultiWaitOver = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
gameconfs->CloseGameConfigFile(g_pGameConf);
|
gameconfs->CloseGameConfigFile(g_pGameConf);
|
||||||
|
|
||||||
// Revert all applied patches
|
// Revert all applied patches
|
||||||
@ -293,6 +318,7 @@ void CSSFixes::SDK_OnUnload()
|
|||||||
|
|
||||||
bool CSSFixes::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late)
|
bool CSSFixes::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late)
|
||||||
{
|
{
|
||||||
|
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,12 @@
|
|||||||
"library" "server"
|
"library" "server"
|
||||||
"linux" "@_ZTV26CTraceFilterNoNPCsOrPlayer"
|
"linux" "@_ZTV26CTraceFilterNoNPCsOrPlayer"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"CTriggerMultiple_MultiWaitOver"
|
||||||
|
{
|
||||||
|
"library" "server"
|
||||||
|
"linux" "@_ZN16CTriggerMultiple13MultiWaitOverEv"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.1"
|
#define SMEXT_CONF_VERSION "1.2"
|
||||||
#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