CTerrorMeleeWeapon::GetPrimaryAttackActivity
0x00568d10 · 376 bytes · __thiscall
_ZN18CTerrorMeleeWeapon24GetPrimaryAttackActivityEP16CMeleeWeaponInfo
Decompiled
undefined (2 params)
/* CTerrorMeleeWeapon::GetPrimaryAttackActivity(CMeleeWeaponInfo*) */
undefined4 __thiscall
CTerrorMeleeWeapon::GetPrimaryAttackActivity(CTerrorMeleeWeapon *this,CMeleeWeaponInfo *param_1)
{
CBaseEdict *pCVar1;
undefined4 *puVar2;
int iVar3;
int iVar4;
CTerrorMeleeWeapon CVar5;
if (*(int *)(param_1 + 0xc2c) < 1) {
return 0xbf;
}
if ((*(float *)(melee_combo_reset_time._28_4_ + 0x2c) <= 0.0) ||
(*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x182c) <=
*(float *)(melee_combo_reset_time._28_4_ + 0x2c))) {
iVar3 = *(int *)(this + 0x17fc);
CVar5 = this[0x6c];
if (iVar3 < *(int *)(param_1 + 0xc2c)) {
if (iVar3 < 8) goto LAB_00568d74;
if (iVar3 == 0) {
iVar4 = 1;
iVar3 = 0;
goto LAB_00568d7d;
}
}
if (CVar5 == (CTerrorMeleeWeapon)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
CVar5 = this[0x6c];
}
}
else {
this[0x70] = (CTerrorMeleeWeapon)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x17fc) = 0;
iVar4 = 1;
iVar3 = 0;
}
else {
if (*(int *)(this + 0x17fc) == 0) {
CVar5 = this[0x6c];
}
else {
if (this[0x6c] == (CTerrorMeleeWeapon)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
CVar5 = (CTerrorMeleeWeapon)0x0;
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
CVar5 = this[0x6c];
}
}
else {
this[0x70] = (CTerrorMeleeWeapon)((byte)this[0x70] | 1);
CVar5 = (CTerrorMeleeWeapon)0x1;
}
*(undefined4 *)(this + 0x17fc) = 0;
}
iVar3 = 0;
LAB_00568d74:
iVar4 = iVar3 + 1;
iVar3 = iVar3 * 0x30;
}
LAB_00568d7d:
puVar2 = (undefined4 *)(iVar3 + *(int *)(param_1 + 0xc20));
*(undefined4 **)(this + 0x1824) = puVar2;
if (CVar5 == (CTerrorMeleeWeapon)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
puVar2 = *(undefined4 **)(this + 0x1824);
}
}
else {
this[0x70] = (CTerrorMeleeWeapon)((byte)this[0x70] | 1);
}
*(int *)(this + 0x17fc) = iVar4;
return *puVar2;
}
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.