FixPlayerCrouchStuck
0x007af0a0 · 1598 bytes · __cdecl
_Z20FixPlayerCrouchStuckP11CBasePlayer
Decompiled
undefined (1 param)
/* FixPlayerCrouchStuck(CBasePlayer*) */
void FixPlayerCrouchStuck(CBasePlayer *param_1)
{
undefined4 uVar1;
int iVar2;
int iVar3;
int local_f4;
undefined4 local_e8;
undefined4 local_e4;
undefined4 local_e0;
CTraceFilterSimple local_dc [16];
float local_cc;
float local_c8;
float local_c4;
undefined4 local_bc;
undefined4 local_b8;
undefined4 local_b4;
float local_ac;
float local_a8;
float local_a4;
float local_9c;
float local_98;
float local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
Vector local_70 [12];
Vector local_64 [43];
char local_39;
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
local_e8 = *(undefined4 *)(param_1 + 0x2e0);
local_f4 = 0x12;
local_e4 = *(undefined4 *)(param_1 + 0x2e4);
local_e0 = *(undefined4 *)(param_1 + 0x2e8);
do {
uVar1 = (**(code **)(*(int *)param_1 + 0x7a0))(param_1,0);
iVar2 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar3 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
if ((((byte)param_1[0x14d] & 8) != 0) &&
(CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1), ((byte)param_1[0x14d] & 8) != 0))
{
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
local_bc = 0;
local_b8 = 0;
local_87 = 0;
local_b4 = 0;
local_8c = 0;
local_9c = (*(float *)(iVar2 + 0x30) - *(float *)(iVar3 + 0x24)) * 0.5;
local_98 = (*(float *)(iVar2 + 0x34) - *(float *)(iVar3 + 0x28)) * 0.5;
local_94 = (*(float *)(iVar2 + 0x38) - *(float *)(iVar3 + 0x2c)) * 0.5;
local_88 = local_9c * local_9c + local_98 * local_98 + local_94 * local_94 < 1e-06;
local_ac = (*(float *)(iVar2 + 0x30) + *(float *)(iVar3 + 0x24)) * 0.5;
local_a8 = (*(float *)(iVar2 + 0x34) + *(float *)(iVar3 + 0x28)) * 0.5;
local_a4 = (*(float *)(iVar2 + 0x38) + *(float *)(iVar3 + 0x2c)) * 0.5;
local_cc = *(float *)(param_1 + 0x2e0) + local_ac;
local_c8 = *(float *)(param_1 + 0x2e4) + local_a8;
local_c4 = *(float *)(param_1 + 0x2e8) + local_a4;
local_ac = -local_ac;
local_a8 = -local_a8;
local_a4 = -local_a4;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,(IHandleEntity *)param_1,8,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,uVar1,local_dc,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,local_64,0xff,0xff,0,true,-1.0);
}
if (local_39 == '\0') {
return;
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
local_cc = *(float *)(param_1 + 0x2e0);
local_c8 = *(float *)(param_1 + 0x2e4);
local_c4 = *(float *)(param_1 + 0x2e8) + 1.0;
CBaseEntity::SetLocalOrigin((CBaseEntity *)param_1,(Vector *)&local_cc);
local_f4 = local_f4 + -1;
} while (local_f4 != 0);
CBaseEntity::SetAbsOrigin((CBaseEntity *)param_1,(Vector *)&local_e8);
local_f4 = 0x12;
while( true ) {
uVar1 = (**(code **)(*(int *)param_1 + 0x7a0))(param_1,0);
iVar2 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar3 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
if ((((byte)param_1[0x14d] & 8) != 0) &&
(CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1), ((byte)param_1[0x14d] & 8) != 0))
{
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
local_bc = 0;
local_b8 = 0;
local_87 = 0;
local_b4 = 0;
local_8c = 0;
local_9c = (*(float *)(iVar2 + 0x30) - *(float *)(iVar3 + 0x24)) * 0.5;
local_98 = (*(float *)(iVar2 + 0x34) - *(float *)(iVar3 + 0x28)) * 0.5;
local_94 = (*(float *)(iVar2 + 0x38) - *(float *)(iVar3 + 0x2c)) * 0.5;
local_88 = local_98 * local_98 + local_9c * local_9c + local_94 * local_94 < 1e-06;
local_ac = (*(float *)(iVar2 + 0x30) + *(float *)(iVar3 + 0x24)) * 0.5;
local_a8 = (*(float *)(iVar2 + 0x34) + *(float *)(iVar3 + 0x28)) * 0.5;
local_a4 = (*(float *)(iVar2 + 0x38) + *(float *)(iVar3 + 0x2c)) * 0.5;
local_cc = *(float *)(param_1 + 0x2e0) + local_ac;
local_c8 = *(float *)(param_1 + 0x2e4) + local_a8;
local_c4 = *(float *)(param_1 + 0x2e8) + local_a4;
local_ac = -local_ac;
local_a8 = -local_a8;
local_a4 = -local_a4;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,(IHandleEntity *)param_1,8,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,uVar1,local_dc,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,local_64,0xff,0xff,0,true,-1.0);
}
if (local_39 == '\0') break;
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
local_cc = *(float *)(param_1 + 0x2e0);
local_c8 = *(float *)(param_1 + 0x2e4);
local_c4 = *(float *)(param_1 + 0x2e8) - 1.0;
CBaseEntity::SetLocalOrigin((CBaseEntity *)param_1,(Vector *)&local_cc);
local_f4 = local_f4 + -1;
if (local_f4 == 0) {
return;
}
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.