CParticleSystemMgr::ReadParticleDefinitions
0x00bd39c0 · 369 bytes · __thiscall
_ZN18CParticleSystemMgr23ReadParticleDefinitionsER10CUtlBufferPKcbb
Decompiled
undefined (5 params)
/* CParticleSystemMgr::ReadParticleDefinitions(CUtlBuffer&, char const*, bool, bool) */
char __thiscall
CParticleSystemMgr::ReadParticleDefinitions
(CParticleSystemMgr *this,CUtlBuffer *param_1,char *param_2,bool param_3,bool param_4)
{
byte bVar1;
char *pcVar2;
int iVar3;
int *piVar4;
int iVar5;
int iVar6;
CParticleSystemDictionary *pCVar7;
char local_31;
CDmxElement *local_20 [4];
BeginDMXContext();
/* try { // try from 00bd39f3 to 00bd3a0e has its CatchHandler @ 00bd3b45 */
local_31 = UnserializeDMX(param_1,local_20,param_2);
if (local_31 == '\0') {
Warning("Unable to read particle definition %s! UtlBuffer is probably the wrong type!\n",param_2
);
LAB_00bd3a0f:
local_31 = '\0';
}
else {
/* try { // try from 00bd3a36 to 00bd3b3a has its CatchHandler @ 00bd3b45 */
pcVar2 = (char *)CDmxElement::GetTypeString(local_20[0]);
iVar3 = _V_stricmp(pcVar2,"DmeParticleSystemDefinition");
if (iVar3 == 0) {
pCVar7 = *(CParticleSystemDictionary **)(this + 0x8c);
iVar3 = CParticleSystemDictionary::AddParticleSystem(pCVar7,local_20[0]);
if ((iVar3 != 0) && (param_3)) {
bVar1 = *(byte *)(iVar3 + 0x41e);
*(byte *)(iVar3 + 0x41e) = bVar1 | 2;
if ((this[0x13f] != (CParticleSystemMgr)0x0) && ((bVar1 & 1) == 0)) {
CParticleSystemDefinition::Precache((CParticleSystemDefinition *)pCVar7);
}
}
}
else {
piVar4 = (int *)CDmxElement::GetAttribute(local_20[0],"particleSystemDefinitions");
if ((piVar4 == (int *)0x0) || (*piVar4 != 0xf)) {
CleanupDMX(local_20[0]);
goto LAB_00bd3a0f;
}
piVar4 = (int *)piVar4[2];
iVar3 = piVar4[3];
if (0 < iVar3) {
iVar6 = 0;
do {
pCVar7 = *(CParticleSystemDictionary **)(this + 0x8c);
iVar5 = CParticleSystemDictionary::AddParticleSystem
(pCVar7,*(CDmxElement **)(*piVar4 + iVar6 * 4));
if ((iVar5 != 0) && (param_3)) {
bVar1 = *(byte *)(iVar5 + 0x41e);
*(byte *)(iVar5 + 0x41e) = bVar1 | 2;
if ((this[0x13f] != (CParticleSystemMgr)0x0) && ((bVar1 & 1) == 0)) {
CParticleSystemDefinition::Precache((CParticleSystemDefinition *)pCVar7);
}
}
iVar6 = iVar6 + 1;
} while (iVar6 != iVar3);
}
}
CleanupDMX(local_20[0]);
}
EndDMXContext(param_4);
return local_31;
}
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.