initial EndTouchFix stuff

This commit is contained in:
rtldg 2021-04-30 21:31:51 +00:00
parent a4a9d0840f
commit 6386098a00
2 changed files with 39 additions and 2 deletions

View File

@ -99,6 +99,13 @@
"windows" "\x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x53\x56\x57\x80\x78\x2A\x00"
"linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x4C\x8B\x15\x2A\x2A\x2A\x2A\x8B\x7D\x2A\x8B\x75\x2A\x0F\xB6\x5D\x2A"
}
// search string:
"PhysicsCheckForEntityUntouch"
{
"windows" "\x55\x8B\xEC\x83\xEC\x08\x56\x8B\xF1\x8B\x86\xD0\x00\x00\x00"
"linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x2C\x8B\x5D\x08\xC7\x44\x24\x04\x01\x00\x00\x00\x89\x1C\x24"
}
}
}
@ -168,6 +175,13 @@
"windows" "\x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x80\x78\x2A\x00\x75\x2A\x83\xB8\x2A\x2A\x2A\x2A\x00"
"linux" "@_ZN13CCSBotManager13BotAddCommandEibPKc12CSWeaponType17BotDifficultyType"
}
// search string:
"PhysicsCheckForEntityUntouch"
{
"windows" "\x55\x8B\xEC\x51\x56\x8B\xF1\x8B\x86\x38\x03\x00\x00"
"linux" "@_ZN11CBaseEntity28PhysicsCheckForEntityUntouchEv"
}
}
}
}

View File

@ -35,6 +35,8 @@
#define DEBUG 0
#define EFL_CHECK_UNTOUCH (1<<24)
enum struct playertimer_t
{
bool bEnabled;
@ -73,8 +75,9 @@ enum struct playertimer_t
EngineVersion gEV_Type = Engine_Unknown;
bool gB_Protobuf = false;
// used for hooking player_speedmod's AcceptInput
DynamicHook gH_AcceptInput;
// hook stuff
DynamicHook gH_AcceptInput; // used for hooking player_speedmod's AcceptInput
Handle gH_PhysicsCheckForEntityUntouch;
// database handle
Database gH_SQL = null;
@ -477,6 +480,13 @@ void LoadDHooks()
DHookAddParam(processMovementPost, HookParamType_ObjectPtr);
DHookRaw(processMovementPost, true, IGameMovement);
StartPrepSDKCall(SDKCall_Entity);
if(!PrepSDKCall_SetFromConf(gamedataConf, SDKConf_Signature, "PhysicsCheckForEntityUntouch"))
{
SetFailState("Failed to get PhysicsCheckForEntityUntouch");
}
gH_PhysicsCheckForEntityUntouch = EndPrepSDKCall();
delete CreateInterface;
delete gamedataConf;
@ -3312,10 +3322,23 @@ public MRESReturn DHook_AcceptInput_player_speedmod(int pThis, DHookReturn hRetu
return MRES_Supercede;
}
bool GetCheckUntouch(int client)
{
int flags = GetEntProp(client, Prop_Data, "m_iEFlags");
return (flags & EFL_CHECK_UNTOUCH) != 0;
}
public MRESReturn DHook_ProcessMovement(Handle hParams)
{
int client = DHookGetParam(hParams, 1);
// Causes client to do zone touching in movement instead of server frames.
// From https://github.com/rumourA/End-Touch-Fix
if(GetCheckUntouch(client))
{
SDKCall(gH_PhysicsCheckForEntityUntouch, client);
}
Call_StartForward(gH_Forwards_OnProcessMovement);
Call_PushCell(client);
Call_Finish();