CVomit::ActivateAbility
0x004e6b10 · 772 bytes · __thiscall
_ZN6CVomit15ActivateAbilityEv
Decompiled
undefined (1 param)
/* CVomit::ActivateAbility() */
void __thiscall CVomit::ActivateAbility(CVomit *this)
{
float fVar1;
uint uVar2;
CBaseEntity *this_00;
CBaseEdict *this_01;
code *pcVar3;
char cVar4;
int iVar5;
int *piVar6;
undefined4 uVar7;
undefined1 *puVar8;
undefined *puVar9;
longdouble lVar10;
cVar4 = (**(code **)(*(int *)this + 0x32c))(this);
if (cVar4 != '\0') {
uVar2 = *(uint *)(this + 0x44c);
if ((((uVar2 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) &&
(this_00 = *(CBaseEntity **)(puVar9 + 4), this_00 != (CBaseEntity *)0x0)) {
if (this[0x45d] != (CVomit)0x1) {
if (this[0x6c] == (CVomit)0x0) {
this_01 = *(CBaseEdict **)(this + 0x30);
if (this_01 != (CBaseEdict *)0x0) {
*(uint *)this_01 = *(uint *)this_01 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(this_01);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CVomit)((byte)this[0x70] | 1);
}
this[0x45d] = (CVomit)0x1;
}
StartVomitEffect(this);
fVar1 = *(float *)(ZombieVomitDuration._28_4_ + 0x2c);
lVar10 = (longdouble)CountdownTimer::Now();
if ((float)lVar10 + fVar1 != *(float *)(this + 0x468)) {
(**(code **)(*(int *)(this + 0x460) + 4))(this + 0x460,this + 0x468);
*(float *)(this + 0x468) = (float)lVar10 + fVar1;
}
if (fVar1 != *(float *)(this + 0x464)) {
(**(code **)(*(int *)(this + 0x460) + 4))(this + 0x460,this + 0x464);
*(float *)(this + 0x464) = fVar1;
}
lVar10 = (longdouble)CountdownTimer::Now();
if ((float)lVar10 + 0.25 != *(float *)(this + 0x474)) {
(**(code **)(*(int *)(this + 0x46c) + 4))(this + 0x46c,this + 0x474);
*(float *)(this + 0x474) = (float)lVar10 + 0.25;
}
if (*(float *)(this + 0x470) != 0.25) {
(**(code **)(*(int *)(this + 0x46c) + 4))(this + 0x46c,this + 0x470);
*(undefined4 *)(this + 0x470) = 0x3e800000;
}
CBaseAbility::StartActivationTimer
((CBaseAbility *)this,*(float *)(ZombieVomitInterval._28_4_ + 0x2c),0.0);
CBaseEntity::EmitSound(this_00,"Vomit.Use",0.0,(float *)0x0);
(**(code **)(*(int *)this_00 + 0x7fc))(this_00,0x29,0);
piVar6 = (int *)CCSPlayer::GetActiveCSWeapon((CCSPlayer *)this_00);
if (piVar6 != (int *)0x0) {
(**(code **)(*piVar6 + 0x3f0))(piVar6,0x1f6);
}
piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"ability_use",0,0);
if (piVar6 != (int *)0x0) {
pcVar3 = *(code **)(*piVar6 + 0x30);
uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
(*pcVar3)(piVar6,"userid",uVar7);
puVar8 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
puVar8 = *(undefined1 **)(this + 0x7c);
}
(**(code **)(*piVar6 + 0x3c))(piVar6,"ability",puVar8);
(**(code **)(*piVar6 + 0x30))(piVar6,"context",0);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
}
CBaseAbility::ActivateAbility((CBaseAbility *)this);
/* WARNING: Could not recover jumptable at 0x004e6daf. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*(int *)this + 0x334))();
return;
}
}
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.