CGameMovement::WalkMove
0x00457240 · 1340 bytes · __thiscall
_ZN13CGameMovement8WalkMoveEv
Decompiled
undefined (1 param)
/* CGameMovement::WalkMove() */
void __thiscall CGameMovement::WalkMove(CGameMovement *this)
{
float fVar1;
float fVar2;
int iVar3;
code *pcVar4;
int *piVar5;
uint *puVar6;
undefined4 uVar7;
undefined *puVar8;
int iVar9;
longdouble lVar10;
float fVar11;
uint local_b4;
float local_ac;
float local_a8;
float local_a4;
float local_a0;
float local_9c;
undefined4 local_98;
float local_94;
float local_90;
float local_8c;
float local_88;
float local_84;
float local_80;
Vector local_7c [12];
undefined1 local_70 [12];
undefined4 local_64;
undefined4 local_60;
undefined4 local_5c;
float local_44;
AngleVectors((QAngle *)(*(int *)(this + 8) + 0xc),(Vector *)&local_94,(Vector *)&local_88,local_7c
);
piVar5 = (int *)CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
local_b4 = 0xffffffff;
if (piVar5 != (int *)0x0) {
puVar6 = (uint *)(**(code **)(*piVar5 + 0xc))(piVar5);
local_b4 = *puVar6;
}
fVar11 = *(float *)(*(int *)(this + 8) + 0x2c);
fVar1 = *(float *)(*(int *)(this + 8) + 0x30);
if (g_bMovementOptimizations == '\0') {
local_8c = 0.0;
local_80 = 0.0;
VectorNormalize((Vector *)&local_94);
VectorNormalize((Vector *)&local_88);
}
else {
if (local_8c != 0.0) {
local_8c = 0.0;
VectorNormalize((Vector *)&local_94);
}
if (local_80 != 0.0) {
local_80 = 0.0;
VectorNormalize((Vector *)&local_88);
}
}
local_a4 = 0.0;
local_a8 = local_84 * fVar1 + local_90 * fVar11;
local_ac = fVar1 * local_88 + fVar11 * local_94;
lVar10 = (longdouble)VectorNormalize((Vector *)&local_ac);
uVar7 = sv_accelerate._28_4_;
fVar11 = (float)lVar10;
if ((fVar11 != 0.0) && (fVar1 = *(float *)(*(int *)(this + 8) + 0x38), fVar1 <= fVar11)) {
fVar11 = fVar1;
}
*(undefined4 *)(*(int *)(this + 8) + 0x48) = 0;
(**(code **)(*(int *)this + 0x68))(this,(Vector *)&local_ac,fVar11,*(undefined4 *)(uVar7 + 0x2c));
*(undefined4 *)(*(int *)(this + 8) + 0x48) = 0;
iVar9 = *(int *)(this + 8);
iVar3 = *(int *)(this + 4);
*(float *)(iVar9 + 0x40) = *(float *)(iVar9 + 0x40) + *(float *)(iVar3 + 0x268);
*(float *)(iVar9 + 0x44) = *(float *)(iVar9 + 0x44) + *(float *)(iVar3 + 0x26c);
*(float *)(iVar9 + 0x48) = *(float *)(iVar9 + 0x48) + *(float *)(iVar3 + 0x270);
iVar9 = *(int *)(this + 8);
fVar1 = *(float *)(iVar9 + 0x40);
fVar2 = *(float *)(iVar9 + 0x44);
if (SQRT(fVar1 * fVar1 + *(float *)(iVar9 + 0x48) * *(float *)(iVar9 + 0x48) + fVar2 * fVar2) <
1.0) {
*(undefined4 *)(iVar9 + 0x40) = 0;
*(undefined4 *)(iVar9 + 0x44) = 0;
*(undefined4 *)(iVar9 + 0x48) = 0;
iVar9 = *(int *)(this + 8);
iVar3 = *(int *)(this + 4);
*(float *)(iVar9 + 0x40) = *(float *)(iVar9 + 0x40) - *(float *)(iVar3 + 0x268);
*(float *)(iVar9 + 0x44) = *(float *)(iVar9 + 0x44) - *(float *)(iVar3 + 0x26c);
*(float *)(iVar9 + 0x48) = *(float *)(iVar9 + 0x48) - *(float *)(iVar3 + 0x270);
return;
}
local_98 = *(undefined4 *)(iVar9 + 0xa4);
local_a0 = fVar1 * *(float *)(gpGlobals + 0x10) + *(float *)(iVar9 + 0x9c);
local_9c = fVar2 * *(float *)(gpGlobals + 0x10) + *(float *)(iVar9 + 0xa0);
pcVar4 = *(code **)(*(int *)this + 0x3c);
uVar7 = (**(code **)(*(int *)this + 0x40))(this,0,0);
(*pcVar4)(this,*(int *)(this + 8) + 0x9c,&local_a0,uVar7,8,local_70);
iVar9 = *(int *)(this + 8);
*(float *)(iVar9 + 0x6c) = local_a8 * fVar11 + *(float *)(iVar9 + 0x6c);
*(float *)(iVar9 + 0x70) = local_a4 * fVar11 + *(float *)(iVar9 + 0x70);
*(float *)(iVar9 + 0x68) = fVar11 * local_ac + *(float *)(iVar9 + 0x68);
if (local_44 == 1.0) {
iVar9 = *(int *)(this + 8);
*(undefined4 *)(iVar9 + 0x9c) = local_64;
*(undefined4 *)(iVar9 + 0xa0) = local_60;
*(undefined4 *)(iVar9 + 0xa4) = local_5c;
}
else {
if ((((local_b4 == 0xffffffff) ||
(puVar8 = g_pEntityList + (local_b4 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar8 + 8) != local_b4 >> 0xc)) || (*(int *)(puVar8 + 4) == 0)) {
iVar9 = *(int *)(this + 4);
if (*(char *)(iVar9 + 0x253) == '\0') goto LAB_0045773f;
}
else {
iVar9 = *(int *)(this + 4);
}
if (*(float *)(iVar9 + 0x2010) != 0.0) {
LAB_0045773f:
iVar3 = *(int *)(this + 8);
*(float *)(iVar3 + 0x40) = *(float *)(iVar3 + 0x40) - *(float *)(iVar9 + 0x268);
*(float *)(iVar3 + 0x44) = *(float *)(iVar3 + 0x44) - *(float *)(iVar9 + 0x26c);
*(float *)(iVar3 + 0x48) = *(float *)(iVar3 + 0x48) - *(float *)(iVar9 + 0x270);
return;
}
(**(code **)(*(int *)this + 0x104))(this,&local_a0,local_70);
}
iVar9 = *(int *)(this + 8);
iVar3 = *(int *)(this + 4);
*(float *)(iVar9 + 0x40) = *(float *)(iVar9 + 0x40) - *(float *)(iVar3 + 0x268);
*(float *)(iVar9 + 0x44) = *(float *)(iVar9 + 0x44) - *(float *)(iVar3 + 0x26c);
*(float *)(iVar9 + 0x48) = *(float *)(iVar9 + 0x48) - *(float *)(iVar3 + 0x270);
StayOnGround(this);
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.