CVomitParticle::Create
0x004e50e0 · 564 bytes · __cdecl
_ZN14CVomitParticle6CreateERK6VectorRK6QAngleP11CBaseEntityP13CTerrorPlayer
Decompiled
undefined (4 params)
/* CVomitParticle::Create(Vector const&, QAngle const&, CBaseEntity*, CTerrorPlayer*) */
CBaseEntity *
CVomitParticle::Create(Vector *param_1,QAngle *param_2,CBaseEntity *param_3,CTerrorPlayer *param_4)
{
float fVar1;
code *pcVar2;
CBaseEntity *this;
undefined4 *puVar3;
undefined4 uVar4;
int iVar5;
int iVar6;
int iVar7;
float fVar8;
float fVar9;
float local_40;
float local_3c;
float local_38;
Vector local_34 [12];
Vector local_28 [24];
if ((param_3 != (CBaseEntity *)0x0) && (param_4 != (CTerrorPlayer *)0x0)) {
this = (CBaseEntity *)CBaseEntity::Create("vomit_particle",param_1,param_2,param_3);
if (this != (CBaseEntity *)0x0) {
(**(code **)(*(int *)this + 0x50))(this,param_3);
puVar3 = (undefined4 *)(**(code **)(*(int *)param_4 + 0xc))(param_4);
*(undefined4 *)(this + 0x470) = *puVar3;
pcVar2 = *(code **)(*(int *)this + 0x194);
uVar4 = CBaseEntity::GetTeamNumber(param_3);
(*pcVar2)(this,uVar4);
AngleVectors(param_2,(Vector *)&local_40,local_34,local_28);
uVar4 = z_vomit_vecrand._28_4_;
fVar8 = *(float *)(z_vomit_velocity._28_4_ + 0x2c);
*(float *)(this + 0x444) = local_3c * fVar8;
*(float *)(this + 0x448) = local_38 * fVar8;
*(float *)(this + 0x440) = local_40 * fVar8;
fVar1 = *(float *)(uVar4 + 0x2c);
fVar9 = -fVar8 * fVar1;
iVar5 = rand();
fVar8 = (fVar1 * fVar8 - fVar9) * 3.051851e-05;
iVar6 = rand();
iVar7 = rand();
*(float *)(this + 0x440) = *(float *)(this + 0x440) + fVar9 + (float)iVar5 * fVar8;
*(float *)(this + 0x444) = *(float *)(this + 0x444) + fVar9 + (float)iVar6 * fVar8;
*(float *)(this + 0x448) = fVar9 + *(float *)(this + 0x448) + (float)iVar7 * fVar8;
if (((byte)param_4[0x14d] & 0x10) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)param_4);
}
*(undefined4 *)(this + 0x44c) = *(undefined4 *)(param_4 + 0x274);
*(undefined4 *)(this + 0x450) = *(undefined4 *)(param_4 + 0x278);
*(undefined4 *)(this + 0x454) = *(undefined4 *)(param_4 + 0x27c);
CBaseEntity::SetAbsVelocity(this,(Vector *)(this + 0x440));
CBaseEntity::SetAbsAngles(this,param_2);
return this;
}
}
return (CBaseEntity *)0x0;
}
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.