CTerrorPlayerAnimState::HandleActivity_Stagger
0x00512e10 · 458 bytes · __thiscall
_ZN22CTerrorPlayerAnimState22HandleActivity_StaggerEv
Decompiled
undefined (1 param)
/* CTerrorPlayerAnimState::HandleActivity_Stagger() */
int __thiscall CTerrorPlayerAnimState::HandleActivity_Stagger(CTerrorPlayerAnimState *this)
{
uint uVar1;
char cVar2;
int iVar3;
int *piVar4;
int iVar5;
if (*(int *)(this + 0x17c) == -1) {
return -1;
}
cVar2 = CTerrorPlayer::IsStaggerTimerActive(*(CTerrorPlayer **)(this + 0x118));
if (cVar2 == '\0') {
*(undefined4 *)(this + 0x17c) = 0xffffffff;
CTerrorPlayer::CancelStagger(*(CTerrorPlayer **)(this + 0x118));
return -1;
}
iVar5 = -1;
ZeroLookYawAndPitch(this);
iVar3 = CTerrorPlayer::GetActiveTerrorWeapon(*(CTerrorPlayer **)(this + 0x118));
if (iVar3 == 0) {
LAB_00512e8b:
uVar1 = *(uint *)(this + 0x17c);
}
else {
piVar4 = (int *)CTerrorPlayer::GetActiveTerrorWeapon(*(CTerrorPlayer **)(this + 0x118));
iVar3 = (**(code **)(*piVar4 + 0x638))(piVar4);
if (iVar3 == 0x13) {
iVar5 = CTerrorPlayer::GetActiveTerrorWeapon(*(CTerrorPlayer **)(this + 0x118));
if (iVar5 == 0) {
piVar4 = (int *)0x0;
}
else {
piVar4 = (int *)__dynamic_cast(iVar5,&CBaseCombatWeapon::typeinfo,
&CTerrorMeleeWeapon::typeinfo,0);
}
iVar5 = (**(code **)(*piVar4 + 0x704))(piVar4);
goto LAB_00512e8b;
}
if (iVar3 < 0x14) {
if (iVar3 != 1) {
LAB_00512fb1:
iVar5 = 0x26d;
goto LAB_00512e8b;
}
}
else {
iVar5 = 0x271;
if (iVar3 == 0x14) goto LAB_00512e8b;
if (iVar3 != 0x20) goto LAB_00512fb1;
}
uVar1 = *(uint *)(this + 0x17c);
iVar5 = 0x279;
}
if (7 < uVar1) {
return -1;
}
switch(uVar1) {
default:
iVar5 = iVar5 + uVar1;
break;
case 4:
iVar5 = 0x300;
iVar3 = CMultiPlayerAnimState::GetMainActivity((CMultiPlayerAnimState *)this);
if (iVar3 != 0x300) {
iVar5 = 0x300;
goto LAB_00512f70;
}
goto LAB_00512f31;
case 5:
iVar5 = 0x2ff;
break;
case 6:
iVar5 = 0x2fd;
break;
case 7:
iVar5 = 0x2fe;
}
iVar3 = CMultiPlayerAnimState::GetMainActivity((CMultiPlayerAnimState *)this);
if (iVar5 != iVar3) {
LAB_00512f70:
(**(code **)(*(int *)this + 0x38))(this);
return iVar5;
}
LAB_00512f31:
if (0.99 < *(float *)(*(CTerrorPlayer **)(this + 0x118) + 0x490)) {
*(undefined4 *)(this + 0x17c) = 0xffffffff;
CTerrorPlayer::CancelStagger(*(CTerrorPlayer **)(this + 0x118));
iVar5 = -1;
}
return iVar5;
}
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.