CTerrorGameMovement::WalkMove
0x004ffee0 · 2083 bytes · __thiscall
_ZN19CTerrorGameMovement8WalkMoveEv
Decompiled
undefined (1 param)
/* CTerrorGameMovement::WalkMove() */
void __thiscall CTerrorGameMovement::WalkMove(CTerrorGameMovement *this)
{
uint uVar1;
int iVar2;
code *pcVar3;
CBaseEntity *pCVar4;
byte bVar5;
char cVar6;
int iVar7;
int *piVar8;
CBaseEntity *pCVar9;
undefined *puVar10;
longdouble lVar11;
float fVar12;
float fVar13;
float fVar14;
float fVar15;
float fVar16;
int local_6c;
undefined *local_64;
float local_60;
float local_58;
float local_54;
undefined4 local_50;
float local_4c;
float local_48;
undefined4 local_44;
Vector local_40 [12];
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
undefined4 local_20;
iVar7 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
if (iVar7 != 0) {
CTerrorPlayer::ClearGrabTarget(*(CTerrorPlayer **)(this + 0x810));
}
piVar8 = (int *)CTerrorPlayer::GetMountedWeapon(*(CTerrorPlayer **)(this + 0x810));
if (piVar8 != (int *)0x0) {
(**(code **)(*piVar8 + 0x474))(piVar8);
iVar7 = *(int *)(this + 8);
local_20 = *(undefined4 *)(iVar7 + 0xa4);
local_24 = local_24 - *(float *)(iVar7 + 0xa0);
local_28 = local_28 - *(float *)(iVar7 + 0x9c);
if (1.0 < local_28 * local_28 + local_24 * local_24) {
lVar11 = (longdouble)(**(code **)(*(int *)this + 0x38))(this);
UpdatePosition(this,(Vector *)&local_28,(float)lVar11);
(**(code **)(*(int *)this + 0xcc))(this,1);
}
return;
}
pCVar9 = *(CBaseEntity **)(this + 0x810);
if (pCVar9 == (CBaseEntity *)0x0) goto LAB_005000ee;
uVar1 = *(uint *)(pCVar9 + 0x33c4);
if ((((uVar1 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar10 + 4) != 0)) {
cVar6 = TongueMove(this);
if (cVar6 != '\0') {
(**(code **)(*(int *)this + 0xcc))(this,0);
return;
}
pCVar9 = *(CBaseEntity **)(this + 0x810);
if (pCVar9 == (CBaseEntity *)0x0) goto LAB_005000ee;
}
if (*(float *)(pCVar9 + 0x2848) <= 0.0) {
bVar5 = 0;
LAB_00500023:
uVar1 = *(uint *)(pCVar9 + 0x30bc);
if (((uVar1 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar10 + 8) == uVar1 >> 0xc &&
((piVar8 = *(int **)(puVar10 + 4), piVar8 != (int *)0x0 &&
(lVar11 = (longdouble)(**(code **)(*piVar8 + 0x36c))(piVar8), 0.0 <= (float)lVar11))))))
goto LAB_005000ee;
}
else {
iVar7 = CBaseEntity::GetTeamNumber(pCVar9);
bVar5 = IsASurvivorTeam(iVar7);
pCVar9 = *(CBaseEntity **)(this + 0x810);
bVar5 = bVar5 ^ 1;
if (pCVar9 != (CBaseEntity *)0x0) goto LAB_00500023;
}
if (bVar5 != 0) {
lVar11 = (longdouble)
__pow_finite((double)((100.0 - *(float *)(&DAT_00002848 + *(int *)(this + 0x810)) *
0.019) * 0.01),
(double)(*(float *)(gpGlobals + 0x10) * 70.0));
*(float *)(*(int *)(this + 8) + 0x40) = *(float *)(*(int *)(this + 8) + 0x40) * (float)lVar11;
*(float *)(*(int *)(this + 8) + 0x44) = (float)lVar11 * *(float *)(*(int *)(this + 8) + 0x44);
}
LAB_005000ee:
local_60 = 0.0;
AngleVectors((QAngle *)(*(int *)(this + 8) + 0xc),(Vector *)&local_58,(Vector *)&local_4c,local_40
);
local_50 = 0;
local_44 = 0;
VectorNormalize((Vector *)&local_58);
VectorNormalize((Vector *)&local_4c);
local_2c = 0.0;
fVar15 = *(float *)(*(int *)(this + 8) + 0x2c);
fVar12 = *(float *)(*(int *)(this + 8) + 0x30);
local_30 = local_48 * fVar12 + local_54 * fVar15;
local_34 = fVar12 * local_4c + fVar15 * local_58;
lVar11 = (longdouble)VectorNormalize((Vector *)&local_34);
local_6c = *(int *)(this + 8);
fVar15 = (float)lVar11;
fVar12 = *(float *)(local_6c + 0x38);
if ((fVar15 <= *(float *)(local_6c + 0x38)) && (fVar12 = local_60, 0.0 <= fVar15)) {
fVar12 = fVar15;
}
pCVar9 = *(CBaseEntity **)(this + 0x810);
uVar1 = *(uint *)(pCVar9 + 0x3e64);
local_64 = g_pEntityList;
if ((((uVar1 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) &&
(pCVar4 = *(CBaseEntity **)(puVar10 + 4), pCVar4 != (CBaseEntity *)0x0)) {
if (((byte)pCVar9[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar9);
}
if (((byte)pCVar4[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar4);
}
local_2c = 0.0;
local_30 = *(float *)(pCVar4 + 0x2e4) - *(float *)(pCVar9 + 0x2e4);
local_34 = *(float *)(pCVar4 + 0x2e0) - *(float *)(pCVar9 + 0x2e0);
lVar11 = (longdouble)VectorNormalize((Vector *)&local_34);
local_6c = *(int *)(this + 8);
fVar15 = (float)lVar11;
fVar12 = *(float *)(local_6c + 0x38);
if ((fVar15 <= *(float *)(local_6c + 0x38)) && (fVar12 = local_60, 0.0 <= fVar15)) {
fVar12 = fVar15;
}
local_64 = g_pEntityList;
pCVar9 = *(CBaseEntity **)(this + 0x810);
}
uVar1 = *(uint *)(pCVar9 + 0x3e44);
g_pEntityList = local_64;
if (((uVar1 != 0xffffffff) &&
(local_64 = local_64 + (uVar1 & 0xfff) * 0x10, local_64 != (undefined *)0xfffffffc)) &&
((*(uint *)(local_64 + 8) == uVar1 >> 0xc &&
(pCVar4 = *(CBaseEntity **)(local_64 + 4), pCVar4 != (CBaseEntity *)0x0)))) {
if (((byte)pCVar9[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar9);
}
if (((byte)pCVar4[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar4);
}
local_2c = 0.0;
local_30 = *(float *)(pCVar4 + 0x2e4) - *(float *)(pCVar9 + 0x2e4);
local_34 = *(float *)(pCVar4 + 0x2e0) - *(float *)(pCVar9 + 0x2e0);
lVar11 = (longdouble)VectorNormalize((Vector *)&local_34);
local_6c = *(int *)(this + 8);
fVar15 = (float)lVar11;
fVar12 = *(float *)(local_6c + 0x38);
if ((fVar15 <= *(float *)(local_6c + 0x38)) && (fVar12 = local_60, 0.0 <= fVar15)) {
fVar12 = fVar15;
}
}
*(undefined4 *)(local_6c + 0x48) = 0;
cVar6 = (**(code **)(**(int **)(this + 0x810) + 0x558))(*(int **)(this + 0x810));
if (((cVar6 == '\0') || ((*(CTerrorPlayer **)(this + 0x810))[0x1a90] != (CTerrorPlayer)0x0)) ||
((*(byte *)(*(int *)(this + 8) + 0x26) & 2) != 0)) {
CTerrorPlayer::IsCrawling(*(CTerrorPlayer **)(this + 0x810));
}
(**(code **)(*(int *)this + 0x68))(this,(Vector *)&local_34,fVar12);
iVar7 = *(int *)(this + 8);
fVar15 = *(float *)(iVar7 + 0x44);
fVar16 = *(float *)(iVar7 + 0x48);
fVar14 = *(float *)(iVar7 + 0x40);
fVar13 = SQRT(fVar16 * fVar16 + fVar15 * fVar15 + fVar14 * fVar14);
if (*(float *)(iVar7 + 0x38) < fVar13) {
fVar13 = *(float *)(iVar7 + 0x38) / fVar13;
*(float *)(iVar7 + 0x40) = fVar14 * fVar13;
*(float *)(*(int *)(this + 8) + 0x44) = fVar13 * *(float *)(*(int *)(this + 8) + 0x44);
iVar7 = *(int *)(this + 8);
fVar14 = *(float *)(iVar7 + 0x40);
fVar15 = *(float *)(iVar7 + 0x44);
fVar16 = *(float *)(iVar7 + 0x48);
}
iVar2 = *(int *)(this + 4);
*(float *)(iVar7 + 0x40) = fVar14 + *(float *)(iVar2 + 0x268);
*(float *)(iVar7 + 0x44) = fVar15 + *(float *)(iVar2 + 0x26c);
*(float *)(iVar7 + 0x48) = fVar16 + *(float *)(iVar2 + 0x270);
iVar7 = *(int *)(this + 8);
fVar15 = *(float *)(iVar7 + 0x40);
fVar16 = *(float *)(iVar7 + 0x44);
if (SQRT(fVar16 * fVar16 + fVar15 * fVar15 + *(float *)(iVar7 + 0x48) * *(float *)(iVar7 + 0x48))
< 1.0) {
*(undefined4 *)(iVar7 + 0x40) = 0;
*(undefined4 *)(iVar7 + 0x44) = 0;
*(undefined4 *)(iVar7 + 0x48) = 0;
return;
}
local_28 = fVar15 * *(float *)(gpGlobals + 0x10) + *(float *)(iVar7 + 0x9c);
local_24 = fVar16 * *(float *)(gpGlobals + 0x10) + *(float *)(iVar7 + 0xa0);
local_20 = *(undefined4 *)(iVar7 + 0xa4);
lVar11 = (longdouble)(**(code **)(*(int *)this + 0x38))(this);
UpdatePosition(this,(Vector *)&local_28,(float)lVar11);
iVar7 = *(int *)(this + 8);
iVar2 = *(int *)(this + 4);
fVar15 = *(float *)(iVar2 + 0x270);
fVar16 = *(float *)(iVar2 + 0x26c);
*(float *)(iVar7 + 0x40) = *(float *)(iVar7 + 0x40) - *(float *)(iVar2 + 0x268);
*(float *)(iVar7 + 0x44) = *(float *)(iVar7 + 0x44) - fVar16;
*(float *)(iVar7 + 0x48) = *(float *)(iVar7 + 0x48) - fVar15;
iVar7 = *(int *)(this + 8);
*(float *)(iVar7 + 0x6c) = local_30 * fVar12 + *(float *)(iVar7 + 0x6c);
*(float *)(iVar7 + 0x70) = local_2c * fVar12 + *(float *)(iVar7 + 0x70);
*(float *)(iVar7 + 0x68) = fVar12 * local_34 + *(float *)(iVar7 + 0x68);
CGameMovement::StayOnGround((CGameMovement *)this);
pcVar3 = *(code **)(*(int *)this + 0x118);
iVar7 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
(*pcVar3)(this,iVar7 != 0);
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.