CParticleCollection::Init
0x00bd2480 · 361 bytes · __thiscall
_ZN19CParticleCollection4InitEP25CParticleSystemDefinition
Decompiled
undefined (2 params)
/* CParticleCollection::Init(CParticleSystemDefinition*) */
undefined4 __thiscall
CParticleCollection::Init(CParticleCollection *this,CParticleSystemDefinition *param_1)
{
float fVar1;
float fVar2;
undefined4 uVar3;
CParticleSystemDefinition *this_00;
int iVar4;
int iVar5;
float local_20;
uVar3 = 0;
if ((*(int *)(param_1 + 0x2b4) <= *(int *)(g_pParticleSystemMgr + 0x154)) &&
(*(int *)(param_1 + 0x2b8) <= *(int *)(g_pParticleSystemMgr + 0x158))) {
iVar4 = *(int *)(param_1 + 0x270);
fVar1 = *(float *)(g_pParticleSystemMgr + 0x148);
local_20 = *(float *)(g_pParticleSystemMgr + 0x144);
fVar2 = *(float *)(g_pParticleSystemMgr + 0x150);
iVar5 = *(int *)(param_1 + 0x274);
this_00 = param_1;
if (0 < iVar4) {
do {
this_00 = (CParticleSystemDefinition *)
CParticleSystemDefinition::GetFallbackReplacementDefinition(this_00);
iVar5 = iVar5 + *(int *)(this_00 + 0x274);
} while (0 < *(int *)(this_00 + 0x270));
iVar4 = *(int *)(param_1 + 0x270);
}
if (fVar2 < *(float *)(g_pParticleSystemMgr + 0x110) * 1000.0) {
local_20 = (*(float *)(g_pParticleSystemMgr + 0x110) * 1000.0 - fVar2) *
*(float *)(g_pParticleSystemMgr + 0x14c) + local_20;
}
while( true ) {
if ((iVar4 < 1) || ((float)iVar5 * fVar1 + local_20 < (float)iVar4)) goto LAB_00bd256b;
iVar5 = iVar5 - *(int *)(param_1 + 0x274);
param_1 = (CParticleSystemDefinition *)
CParticleSystemDefinition::GetFallbackReplacementDefinition(param_1);
if (param_1 == (CParticleSystemDefinition *)0x0) break;
iVar4 = *(int *)(param_1 + 0x270);
}
Warning("Particlelib: Missing precache for particle system type \"%s\"!\n","unknown");
param_1 = (CParticleSystemDefinition *)
CParticleSystemDictionary::FindParticleSystem(*(char **)(g_pParticleSystemMgr + 0x8c))
;
LAB_00bd256b:
Init(this,param_1,0.0,0);
uVar3 = CONCAT31((int3)((uint)*(int *)(this + 0x48) >> 8),*(int *)(this + 0x48) != 0);
}
return uVar3;
}
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.