CTerrorPlayerAnimState::TranslateActivity
0x00519040 · 734 bytes · __thiscall
_ZN22CTerrorPlayerAnimState17TranslateActivityE8Activity
Decompiled
undefined (2 params)
/* CTerrorPlayerAnimState::TranslateActivity(Activity) */
undefined4 __thiscall
CTerrorPlayerAnimState::TranslateActivity(CTerrorPlayerAnimState *this,int param_2)
{
uint uVar1;
int *piVar2;
char cVar3;
int *piVar4;
int iVar5;
undefined4 uVar6;
int iVar7;
undefined *puVar8;
CBaseEntity *pCVar9;
bool bVar10;
longdouble lVar11;
longdouble lVar12;
if (*(CCSPlayer **)(this + 0x118) == (CCSPlayer *)0x0) goto LAB_0051917e;
piVar4 = (int *)CCSPlayer::GetActiveCSWeapon(*(CCSPlayer **)(this + 0x118));
pCVar9 = *(CBaseEntity **)(this + 0x118);
if (piVar4 == (int *)0x0) {
iVar7 = CBaseEntity::GetTeamNumber(pCVar9);
cVar3 = IsASurvivorTeam(iVar7);
if ((cVar3 != '\0') && (param_2 == 1)) {
return 0x42d;
}
goto LAB_0051917e;
}
iVar7 = *(int *)(pCVar9 + 0x100);
lVar11 = (longdouble)(**(code **)(*(int *)pCVar9 + 0x7e4))(pCVar9);
iVar5 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 0x118));
cVar3 = IsASurvivorTeam(iVar5);
iVar5 = param_2;
if (cVar3 == '\0') {
LAB_005190a6:
bVar10 = param_2 == 10;
param_2 = iVar5;
if (bVar10) {
pCVar9 = *(CBaseEntity **)(this + 0x118);
LAB_0051927e:
iVar7 = CBaseEntity::GetTeamNumber(pCVar9);
param_2 = iVar5;
if (((((iVar7 == 3) && (iVar7 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9), iVar7 == 6)) &&
(uVar1 = *(uint *)(*(int *)(this + 0x118) + 0x30bc), uVar1 != 0xffffffff)) &&
((puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc &&
(*(uint *)(puVar8 + 8) == uVar1 >> 0xc)))) &&
((piVar2 = *(int **)(puVar8 + 4), piVar2 != (int *)0x0 &&
(cVar3 = (**(code **)(*piVar2 + 0x354))(piVar2), cVar3 != '\0')))) {
return 0x301;
}
}
}
else {
piVar2 = *(int **)(this + 0x118);
if ((((char)piVar2[0xcbf] != '\0') &&
(lVar12 = (longdouble)(**(code **)(*piVar2 + 0x7e4))(piVar2), (float)lVar12 <= 0.0)) &&
(piVar2[0x40] < 2)) {
if (param_2 == 1) goto LAB_005190e0;
if ((param_2 == 10) || (param_2 == 6)) {
iVar5 = 0x1fe;
}
goto LAB_005190a6;
}
if ((float)iVar7 + (float)lVar11 < *(float *)(SurvivorLimpHealth._28_4_ + 0x2c)) {
if ((param_2 == 1) || (param_2 == 6)) goto LAB_005190e0;
if (param_2 != 10) goto LAB_005190af;
pCVar9 = *(CBaseEntity **)(this + 0x118);
iVar5 = 0x1ff;
goto LAB_0051927e;
}
pCVar9 = *(CBaseEntity **)(this + 0x118);
if (pCVar9[0x2e78] == (CBaseEntity)0x0) goto LAB_005190a6;
if ((param_2 == 1) || (param_2 == 6)) goto LAB_005190e0;
if (param_2 == 10) {
iVar5 = 0x202;
goto LAB_0051927e;
}
}
LAB_005190af:
if (param_2 != 0x1d) {
if (0x1d < param_2) {
if (param_2 < 0x203) {
if (((0x1fd < param_2) || (param_2 == 0x2d)) || (param_2 == 0x1fc)) goto LAB_005190e0;
}
else if (param_2 == 0x2be) goto LAB_005190e0;
LAB_0051917e:
uVar6 = CMultiPlayerAnimState::TranslateActivity();
return uVar6;
}
if (param_2 != 6) {
if (param_2 < 7) {
if (param_2 == 1) goto LAB_005190e0;
}
else if ((param_2 == 10) || (param_2 == 0xc)) goto LAB_005190e0;
goto LAB_0051917e;
}
}
LAB_005190e0:
/* WARNING: Could not recover jumptable at 0x005190f8. Too many branches */
/* WARNING: Treating indirect jump as call */
uVar6 = (**(code **)(*piVar4 + 0x614))();
return uVar6;
}
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.