PlayerLocomotion::Update
0x0076d510 · 744 bytes · __thiscall
_ZN16PlayerLocomotion6UpdateEv
Decompiled
undefined (1 param)
/* PlayerLocomotion::Update() */
void __thiscall PlayerLocomotion::Update(PlayerLocomotion *this)
{
code *pcVar1;
int iVar2;
char cVar3;
float *pfVar4;
int *piVar5;
PlayerLocomotion *pPVar6;
CBaseEntity *pCVar7;
PlayerLocomotion **ppPVar8;
longdouble lVar9;
float fVar10;
float fVar11;
float fVar12;
PlayerLocomotion *local_80;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
local_80 = (PlayerLocomotion *)0x76d524;
cVar3 = TraverseLadder(this);
ppPVar8 = (PlayerLocomotion **)&stack0xffffff84;
if ((cVar3 == '\0') &&
((this[0x81] != (PlayerLocomotion)0x0 ||
(ppPVar8 = (PlayerLocomotion **)&stack0xffffff84, this[0x80] != (PlayerLocomotion)0x0)))) {
pcVar1 = *(code **)(*(int *)this + 0x180);
local_80 = (PlayerLocomotion *)0x76d553;
(**(code **)(*(int *)this + 0x13c))();
local_80 = (PlayerLocomotion *)0x76d566;
(*pcVar1)();
local_80 = (PlayerLocomotion *)0x76d571;
pfVar4 = (float *)(**(code **)(*(int *)this + 300))();
local_40 = *(float *)(this + 0x84) - *pfVar4;
local_3c = *(float *)(this + 0x88) - pfVar4[1];
local_38 = 0.0;
local_80 = (PlayerLocomotion *)0x76d5a6;
VectorNormalize((Vector *)&local_40);
if (this[0x90] == (PlayerLocomotion)0x0) {
local_80 = (PlayerLocomotion *)0x76d6e6;
cVar3 = (**(code **)(*(int *)this + 200))();
if (cVar3 == '\0') {
local_80 = (PlayerLocomotion *)0x76d80b;
(**(code **)(*(int *)this + 0xc4))();
}
local_80 = (PlayerLocomotion *)0x76d6f9;
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))();
local_80 = (PlayerLocomotion *)0x76d704;
pCVar7 = (CBaseEntity *)(**(code **)(*piVar5 + 0xb4))();
if (((byte)pCVar7[0x14d] & 0x10) != 0) {
local_80 = (PlayerLocomotion *)0x76d7cb;
CBaseEntity::CalcAbsoluteVelocity(pCVar7);
}
local_28 = *(float *)(pCVar7 + 0x274);
local_24 = *(float *)(pCVar7 + 0x278);
local_20 = *(float *)(pCVar7 + 0x27c);
if (this[0x81] != (PlayerLocomotion)0x0) {
local_80 = (PlayerLocomotion *)0x76d78b;
lVar9 = (longdouble)(**(code **)(*(int *)this + 0x13c))();
local_28 = (float)lVar9 * local_40;
local_80 = (PlayerLocomotion *)0x76d7a8;
lVar9 = (longdouble)(**(code **)(*(int *)this + 0x13c))();
local_24 = (float)lVar9 * local_3c;
}
local_80 = (PlayerLocomotion *)0x76d740;
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))();
local_80 = (PlayerLocomotion *)0x76d74b;
pCVar7 = (CBaseEntity *)(**(code **)(*piVar5 + 0xb4))();
local_80 = (PlayerLocomotion *)0x76d75a;
CBaseEntity::SetAbsVelocity(pCVar7,(Vector *)&local_28);
local_80 = (PlayerLocomotion *)0x76d765;
cVar3 = (**(code **)(*(int *)this + 0xf8))();
ppPVar8 = (PlayerLocomotion **)&stack0xffffff84;
if (cVar3 == '\0') {
this[0x90] = (PlayerLocomotion)0x1;
ppPVar8 = (PlayerLocomotion **)&stack0xffffff84;
}
}
else {
local_80 = (PlayerLocomotion *)0x76d5c0;
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))();
local_80 = (PlayerLocomotion *)0x76d5cb;
pPVar6 = (PlayerLocomotion *)(**(code **)(*piVar5 + 0xc4))();
fVar12 = local_40 * 100.0;
fVar11 = local_3c * 100.0;
pcVar1 = *(code **)(*(int *)pPVar6 + 0xc0);
fVar10 = local_38 * 100.0;
local_80 = (PlayerLocomotion *)0x76d60e;
piVar5 = (int *)(**(code **)(*(int *)this + 0xb0))();
local_80 = (PlayerLocomotion *)0x76d619;
piVar5 = (int *)(**(code **)(*piVar5 + 0xb4))();
local_80 = (PlayerLocomotion *)0x76d62b;
(**(code **)(*piVar5 + 0x234))();
local_28 = fVar12 + local_34;
local_24 = fVar11 + local_30;
local_20 = fVar10 + local_2c;
local_80 = pPVar6;
(*pcVar1)();
local_80 = this;
cVar3 = (**(code **)(*(int *)this + 0xf8))();
ppPVar8 = &local_80;
if (cVar3 != '\0') {
this[0x80] = (PlayerLocomotion)0x0;
this[0x81] = (PlayerLocomotion)0x0;
local_80 = this;
(**(code **)(*(int *)this + 0x180))();
ppPVar8 = &local_80;
}
}
iVar2 = *(int *)this;
ppPVar8[2] = (PlayerLocomotion *)0x3f800000;
ppPVar8[1] = this + 0x84;
*ppPVar8 = this;
pcVar1 = *(code **)(iVar2 + 0xb4);
ppPVar8[-1] = (PlayerLocomotion *)0x76d6c7;
(*pcVar1)();
}
*ppPVar8 = this;
ppPVar8[-1] = (PlayerLocomotion *)0x76d6cf;
ILocomotion::Update((ILocomotion *)*ppPVar8);
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.