CTerrorGameMovement::CheckStacking
0x005010d0 · 965 bytes · __thiscall
_ZN19CTerrorGameMovement13CheckStackingEv
Decompiled
undefined (1 param)
/* CTerrorGameMovement::CheckStacking() */
void __thiscall CTerrorGameMovement::CheckStacking(CTerrorGameMovement *this)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
char cVar7;
int *piVar8;
int iVar9;
CBaseEntity *pCVar10;
NextBotManager *this_00;
longdouble lVar11;
float local_a8;
float local_a4;
float local_a0;
float local_9c;
float local_98;
float local_94;
void *local_90;
undefined4 local_8c;
undefined4 local_88;
int local_84;
void *local_80;
float local_7c;
float local_78;
undefined4 local_74;
if ((((*(int *)(this + 0x810) == 0) || ((*(byte *)(*(int *)(this + 0x810) + 0x1d20) & 8) == 0)) &&
((*(CBaseEntity **)(this + 4))[0x186] != (CBaseEntity)0x9)) &&
(((piVar8 = (int *)CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4)),
piVar8 != (int *)0x0 &&
(cVar7 = CTerrorPlayer::IsLunging(*(CTerrorPlayer **)(this + 0x810)), cVar7 == '\0')) &&
((iVar9 = (**(code **)(*piVar8 + 0x144))(piVar8), iVar9 != 0 &&
(iVar9 = CBaseEntity::MyNPCPointer(), iVar9 == 0)))))) {
cVar7 = (**(code **)(*piVar8 + 0x16c))(piVar8);
if (((cVar7 == '\0') &&
(pCVar10 = (CBaseEntity *)(**(code **)(*piVar8 + 0x14c))(piVar8),
pCVar10 != (CBaseEntity *)0x0)) &&
((iVar9 = CBaseEntity::GetTeamNumber(pCVar10), iVar9 != 3 ||
(iVar9 = (**(code **)(*(int *)pCVar10 + 0x544))(pCVar10), iVar9 == 0)))) {
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
pCVar10 = *(CBaseEntity **)(this + 4);
if (((byte)pCVar10[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar10);
}
fVar1 = *(float *)(iVar9 + 0x24);
fVar2 = *(float *)(iVar9 + 0x28);
fVar3 = *(float *)(pCVar10 + 0x2e8);
fVar4 = *(float *)(pCVar10 + 0x2e0);
fVar5 = *(float *)(pCVar10 + 0x2e4);
fVar6 = *(float *)(iVar9 + 0x2c);
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
pCVar10 = *(CBaseEntity **)(this + 4);
if (((byte)pCVar10[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar10);
}
local_8c = 0x20;
local_9c = *(float *)(iVar9 + 0x30) + *(float *)(pCVar10 + 0x2e0);
local_88 = 0;
local_98 = *(float *)(iVar9 + 0x34) + *(float *)(pCVar10 + 0x2e4);
local_94 = *(float *)(iVar9 + 0x38) + *(float *)(pCVar10 + 0x2e8);
local_a0 = fVar3 + fVar6 + -18.0;
local_a8 = fVar1 + fVar4;
local_a4 = fVar2 + fVar5;
local_90 = malloc(0x80);
local_84 = 0;
local_80 = local_90;
/* try { // try from 0050139f to 00501408 has its CatchHandler @ 0050149a */
this_00 = (NextBotManager *)TheNextBots();
NextBotManager::ForEachCombatCharacter<InfectedGroundCollector>
(this_00,(InfectedGroundCollector *)&local_a8);
iVar9 = 0;
if (0 < local_84) {
do {
piVar8 = *(int **)((int)local_90 + iVar9 * 4);
CTakeDamageInfo::CTakeDamageInfo
((CTakeDamageInfo *)&local_7c,*(CBaseEntity **)(this + 4),
*(CBaseEntity **)(this + 4),50.0,0x80,0);
(**(code **)(*piVar8 + 0x124))(piVar8,&local_7c);
iVar9 = iVar9 + 1;
} while (iVar9 < local_84);
}
local_84 = 0;
CUtlMemory<Infected*,int>::Purge((CUtlMemory<Infected*,int> *)&local_90);
local_80 = local_90;
CUtlMemory<Infected*,int>::Purge((CUtlMemory<Infected*,int> *)&local_90);
}
else {
local_7c = *(float *)(*(int *)(this + 8) + 0x40);
local_78 = *(float *)(*(int *)(this + 8) + 0x44);
local_74 = 0;
if ((((-1e-05 < local_7c) && (local_7c < 1e-05)) && (-1e-05 < local_78)) && (local_78 < 1e-05)
) {
lVar11 = (longdouble)RandomFloat(0xbf800000,0x3f800000);
local_7c = (float)lVar11;
lVar11 = (longdouble)RandomFloat(0xbf800000,0x3f800000);
local_78 = (float)lVar11;
}
VectorNormalize((Vector *)&local_7c);
ComputeMoveTowardVector
(*(CTerrorPlayer **)(this + 0x810),(Vector *)&local_7c,*(CMoveData **)(this + 8));
*(float *)(*(int *)(this + 8) + 0x2c) = *(float *)(*(int *)(this + 8) + 0x2c) * 3.0;
*(float *)(*(int *)(this + 8) + 0x30) = *(float *)(*(int *)(this + 8) + 0x30) * 3.0;
*(undefined4 *)(*(int *)(this + 8) + 0x24) = 0;
*(undefined4 *)(*(int *)(this + 8) + 8) = 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.