CTerrorGun::SendWeaponAnim
0x005660f0 · 652 bytes · __thiscall
_ZN10CTerrorGun14SendWeaponAnimEi
Decompiled
undefined (2 params)
/* CTerrorGun::SendWeaponAnim(int) */
void __thiscall CTerrorGun::SendWeaponAnim(CTerrorGun *this,int param_1)
{
float fVar1;
char cVar2;
int iVar3;
int *piVar4;
int iVar5;
char *pcVar6;
undefined4 uVar7;
undefined4 uVar8;
iVar3 = (**(code **)(*(int *)this + 0x6bc))(this,param_1);
piVar4 = (int *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
if (piVar4 == (int *)0x0) goto LAB_00566161;
if (param_1 == 0xb3) {
if ((this[0x17e2] != (CTerrorGun)0x0) &&
((3 < *(int *)(this + 0x17dc) - 2U ||
((1 << ((byte)(*(int *)(this + 0x17dc) - 2U) & 0x1f) & 0xdU) == 0)))) {
(**(code **)(*piVar4 + 0x7fc))(piVar4,4,0);
iVar3 = *(int *)this;
uVar7 = 0xd9;
goto LAB_005661a9;
}
}
else if ((param_1 == 0xc1) && (this[0x145d] == (CTerrorGun)0x0)) {
(**(code **)(*piVar4 + 0x7fc))(piVar4,4,0);
iVar3 = *(int *)this;
uVar7 = 0xc1;
LAB_005661a9:
iVar3 = (**(code **)(iVar3 + 0x6bc))(this,uVar7);
cVar2 = (**(code **)(*(int *)this + 0x674))(this);
PlayReloadSoundEffects(piVar4,iVar3,this,(-(uint)(cVar2 == '\0') & 0xfffffff6) + 0x10);
}
if (iVar3 != 0xb7) {
if (piVar4[0xc] == 0) {
iVar5 = 0;
}
else {
iVar5 = piVar4[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
}
if (*(int *)(GunDebugPlayerIndex._28_4_ + 0x30) == iVar5) {
pcVar6 = (char *)ActivityList_NameForIndex(iVar3);
iVar5 = (**(code **)(*(int *)this + 0x340))(this,iVar3);
if (iVar5 < 0) {
iVar5 = V_stristr(pcVar6,"holster");
if (iVar5 == 0) {
fVar1 = *(float *)(gpGlobals + 0xc);
iVar5 = (**(code **)(*(int *)this + 0x638))(this);
uVar7 = WeaponIDToAlias(iVar5);
uVar8 = (**(code **)(*piVar4 + 0xb8))(piVar4);
DevWarning("%s %s %s SendWeaponAnim(missing %s) @ %f!\n","server",uVar8,uVar7,pcVar6,
(double)fVar1);
}
}
else {
iVar5 = V_stristr(pcVar6,"idle");
if (iVar5 == 0) {
fVar1 = *(float *)(gpGlobals + 0xc);
iVar5 = (**(code **)(*(int *)this + 0x638))(this);
uVar7 = WeaponIDToAlias(iVar5);
uVar8 = (**(code **)(*piVar4 + 0xb8))(piVar4);
DevMsg("%s %s %s SendWeaponAnim(%s) @ %f\n","server",uVar8,uVar7,pcVar6,(double)fVar1);
}
}
}
}
LAB_00566161:
CTerrorWeapon::SendWeaponAnim((CTerrorWeapon *)this,iVar3);
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.