CParticleCollection::Simulate
0x00bce0a0 · 2239 bytes · __thiscall
_ZN19CParticleCollection8SimulateEf
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CParticleCollection::Simulate(float) */
void __thiscall CParticleCollection::Simulate(CParticleCollection *this,float param_1)
{
uint *puVar1;
int iVar2;
bool bVar3;
char cVar4;
int iVar5;
uint uVar6;
int iVar7;
void *__s;
CParticleCollection *pCVar8;
int *piVar9;
int iVar10;
CParticleCollection *pCVar11;
byte bVar12;
float fVar13;
float fVar14;
CParticleCollection *in_stack_ffffff74;
char *in_stack_ffffff78;
CParticleCollection *in_stack_ffffff7c;
float local_50;
float local_4c;
CParticleCollection *local_44;
CParticleCollection *local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
CParticleCollection *local_20;
bVar12 = 0;
local_34 = 0;
local_30 = 0;
if (_towlower == (CParticleCollection *)0x0) {
local_20 = (CParticleCollection *)0x0;
}
else {
in_stack_ffffff78 = (char *)&local_34;
in_stack_ffffff7c = (CParticleCollection *)0x0;
in_stack_ffffff74 = _towlower;
(**(code **)(_towlower + 0x50))();
local_20 = _towlower;
}
iVar2 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 00bce151 to 00bce155 has its CatchHandler @ 00bce972 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar5 = ThreadGetCurrentId(), iVar2 == iVar5)) {
if (*(char **)_DAT_0105d15c != "CParticleCollection::Simulate") {
in_stack_ffffff7c = (CParticleCollection *)0x0;
in_stack_ffffff78 = "CParticleCollection::Simulate";
/* try { // try from 00bce4e4 to 00bce507 has its CatchHandler @ 00bce972 */
_DAT_0105d15c =
(CParticleCollection *)
CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd5593c,(char *)0x0,0xd55928);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + *(int *)(_DAT_0105d15c + 0x70) * 8);
*puVar1 = *puVar1 | 4;
in_stack_ffffff74 = _DAT_0105d15c;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
if (((0.0 <= param_1) && (this[0x58] == (CParticleCollection)0x0)) && (*(int *)(this + 0x48) != 0)
) {
if (*(float *)(this + 0x24) < 0.0) {
if (1e-22 <= param_1) {
fVar14 = *(float *)(this + 0x24) + param_1;
*(float *)(this + 0x24) = fVar14;
*(float *)(this + 0x10) = fVar14;
*(float *)(this + 0x14) = fVar14;
*(float *)(this + 0x18) = fVar14;
*(float *)(this + 0x1c) = fVar14;
UpdatePrevControlPoints(this,param_1);
}
}
else {
if ((*(uint *)(this + 0x328) & 1) == 0) {
if ((*(uint *)(this + 0x328) & 2) == 0) {
in_stack_ffffff78 = *(char **)(this + 0x38);
in_stack_ffffff74 = this;
UpdatePrevControlPoints(this,(float)in_stack_ffffff78);
}
}
else {
in_stack_ffffff74 = this;
/* try { // try from 00bce90e to 00bce912 has its CatchHandler @ 00bce9a8 */
SimulateFirstFrame(this);
*(uint *)(this + 0x328) = *(uint *)(this + 0x328) & 0xfffffffe;
}
if (1e-22 <= param_1) {
iVar2 = *(int *)(this + 0x374);
this[0x56] = (CParticleCollection)0x0;
if (iVar2 == 0) {
in_stack_ffffff74 = (CParticleCollection *)g_pParticleSystemMgr;
in_stack_ffffff78 = (char *)this;
/* try { // try from 00bce99a to 00bce99e has its CatchHandler @ 00bce9a8 */
CParticleSystemMgr::AttachKillList((CParticleSystemMgr *)g_pParticleSystemMgr,this);
}
iVar5 = *(int *)(this + 0x48);
local_50 = *(float *)(iVar5 + 0x2a0);
if (local_50 <= 0.0) {
fVar14 = 1.0;
local_50 = 0.1;
}
else {
fVar14 = local_50 * 10.0;
}
fVar13 = *(float *)(iVar5 + 0x2a4);
local_4c = param_1;
if ((fVar13 != 0.0) && (*(int *)(this + 0x330) <= *(int *)(iVar5 + 0x2b0))) {
if (fVar13 < param_1 + *(float *)(this + 0x24)) {
local_4c = fVar13 - *(float *)(this + 0x24);
if (local_4c <= *(float *)(iVar5 + 0x2a8)) {
local_4c = *(float *)(iVar5 + 0x2a8);
}
}
*(int *)(this + 0x330) = *(int *)(this + 0x330) + 1;
}
if (fVar14 <= local_4c) {
local_4c = fVar14;
}
fVar14 = local_4c + *(float *)(this + 0x2c);
*(float *)(this + 0x2c) = fVar14;
if (((fVar14 < *(float *)(this + 0x28)) || (*(float *)(this + 0x24) <= fVar14)) &&
(fVar14 = *(float *)(iVar5 + 0x2ac), 0.0 < local_4c)) {
bVar3 = false;
do {
fVar13 = local_4c;
if (local_4c <= local_50) {
if (fVar14 <= local_4c) {
local_4c = 0.0;
}
else {
bVar3 = true;
local_4c = local_4c - fVar14;
fVar13 = fVar14;
}
}
else {
local_4c = local_4c - local_50;
fVar13 = local_50;
}
if (*(float *)(this + 0x34) != 0.0) {
*(float *)(this + 0x38) = *(float *)(this + 0x34);
}
*(float *)(this + 0x34) = fVar13;
*(float *)(this + 0x28) = *(float *)(this + 0x24);
fVar13 = *(float *)(this + 0x24) + fVar13;
*(float *)(this + 0x24) = fVar13;
*(float *)(this + 0x10) = fVar13;
*(float *)(this + 0x14) = fVar13;
*(float *)(this + 0x18) = fVar13;
*(float *)(this + 0x1c) = fVar13;
if (bVar3) {
if (*(int *)(this + 0xc4) == 0) {
__s = (void *)memalign(0x10,*(undefined4 *)(this + 0xb4));
in_stack_ffffff7c = *(CParticleCollection **)(this + 0xb4);
*(void **)(this + 0xc4) = __s;
in_stack_ffffff78 = (char *)0x0;
memset(__s,0,(size_t)in_stack_ffffff7c);
pCVar11 = this + 0xd4;
pCVar8 = this + 0x254;
for (iVar5 = 0x30; iVar5 != 0; iVar5 = iVar5 + -1) {
*(undefined4 *)pCVar8 = *(undefined4 *)pCVar11;
pCVar11 = pCVar11 + (uint)bVar12 * -8 + 4;
pCVar8 = pCVar8 + (uint)bVar12 * -8 + 4;
}
pCVar11 = this + 0xd4;
pCVar8 = pCVar11;
do {
if (*(int *)(pCVar11 + (int)(pCVar8 + (-0x74 - (int)this))) != 0) {
*(int *)(pCVar8 + 0x180) =
(*(int *)(pCVar11 + (int)(pCVar8 + (-0xd4 - (int)this))) -
*(int *)(this + 0xb8)) + *(int *)(this + 0xc4);
}
pCVar8 = pCVar8 + 4;
} while (pCVar8 != this + 0x134);
}
in_stack_ffffff74 = this;
CopyParticleAttributesToPreviousAttributes(this);
}
*(undefined4 *)(this + 0x34c) = 0;
iVar7 = *(int *)(this + 0x48);
iVar5 = *(int *)(iVar7 + 0x314);
if (0 < iVar5) {
iVar10 = 0;
do {
pCVar11 = *(CParticleCollection **)(*(int *)(iVar7 + 0x308) + iVar10 * 4);
in_stack_ffffff74 = pCVar11;
cVar4 = (**(code **)(*(int *)pCVar11 + 0x70))();
if (cVar4 != '\0') {
if (pCVar11[0x3c] == (CParticleCollection)0x0) {
cVar4 = CheckIfOperatorShouldRun
(in_stack_ffffff74,
(CParticleOperatorInstance *)in_stack_ffffff78,
(float *)in_stack_ffffff7c);
if (cVar4 == '\0') goto LAB_00bce38a;
}
else {
local_38 = (CParticleCollection *)0x3f800000;
}
/* try { // try from 00bce372 to 00bce3b3 has its CatchHandler @ 00bce9a8 */
in_stack_ffffff78 = (char *)this;
in_stack_ffffff7c = local_38;
(**(code **)(*(int *)pCVar11 + 0x24))();
in_stack_ffffff74 = pCVar11;
if (*(int *)(this + 0x370) != 0) {
in_stack_ffffff74 = this;
ApplyKillList(this);
}
*(int *)(this + 0x34c) = *(int *)(this + 0x34c) + 0x11;
}
LAB_00bce38a:
iVar10 = iVar10 + 1;
iVar7 = *(int *)(this + 0x48);
} while (iVar10 != iVar5);
}
iVar5 = *(int *)(iVar7 + 0x350);
if (iVar5 < 1) {
local_44 = *(CParticleCollection **)(this + 0x30);
}
else {
local_44 = *(CParticleCollection **)(this + 0x30);
iVar10 = 0;
do {
piVar9 = (int *)(*(int *)(iVar7 + 0x344) + iVar10 * 4);
if (*(char *)(*piVar9 + 0x3c) == '\0') {
cVar4 = CheckIfOperatorShouldRun
(in_stack_ffffff74,
(CParticleOperatorInstance *)in_stack_ffffff78,
(float *)in_stack_ffffff7c);
if (cVar4 != '\0') {
piVar9 = (int *)(*(int *)(*(int *)(this + 0x48) + 0x344) + iVar10 * 4);
goto LAB_00bce56f;
}
LAB_00bce5b9:
local_44 = *(CParticleCollection **)(this + 0x30);
}
else {
local_38 = (CParticleCollection *)0x3f800000;
LAB_00bce56f:
in_stack_ffffff74 = (CParticleCollection *)*piVar9;
/* try { // try from 00bce596 to 00bce7bd has its CatchHandler @ 00bce9a8 */
in_stack_ffffff78 = (char *)this;
in_stack_ffffff7c = local_38;
uVar6 = (**(code **)(*(int *)in_stack_ffffff74 + 0x38))();
if (*(CParticleCollection **)(this + 0x30) != local_44) {
in_stack_ffffff7c = *(CParticleCollection **)(this + 0x30) + -(int)local_44;
in_stack_ffffff74 = this;
InitializeNewParticles(this,(int)local_44,(int)in_stack_ffffff7c,uVar6);
in_stack_ffffff78 = (char *)local_44;
goto LAB_00bce5b9;
}
}
iVar10 = iVar10 + 1;
iVar7 = *(int *)(this + 0x48);
} while (iVar10 != iVar5);
}
*(undefined4 *)(this + 0x34c) = 0;
iVar5 = *(int *)(iVar7 + 0x314);
if ((local_44 != (CParticleCollection *)0x0) && (0 < iVar5)) {
iVar10 = 0;
do {
pCVar11 = *(CParticleCollection **)(*(int *)(iVar7 + 0x308) + iVar10 * 4);
in_stack_ffffff74 = pCVar11;
cVar4 = (**(code **)(*(int *)pCVar11 + 0x70))();
if (cVar4 == '\0') {
if (pCVar11[0x3c] == (CParticleCollection)0x0) {
cVar4 = CheckIfOperatorShouldRun
(in_stack_ffffff74,
(CParticleOperatorInstance *)in_stack_ffffff78,
(float *)in_stack_ffffff7c);
if (cVar4 == '\0') goto LAB_00bce69e;
}
else {
local_38 = (CParticleCollection *)0x3f800000;
}
in_stack_ffffff78 = (char *)this;
in_stack_ffffff7c = local_38;
(**(code **)(*(int *)pCVar11 + 0x24))();
in_stack_ffffff74 = pCVar11;
if ((*(int *)(this + 0x370) != 0) &&
(in_stack_ffffff74 = this, ApplyKillList(this), *(int *)(this + 0x30) == 0))
break;
*(int *)(this + 0x34c) = *(int *)(this + 0x34c) + 0x11;
}
LAB_00bce69e:
iVar10 = iVar10 + 1;
if (iVar10 == iVar5) break;
iVar7 = *(int *)(this + 0x48);
} while( true );
}
} while (0.0 < local_4c);
}
for (pCVar11 = *(CParticleCollection **)(this + 0x90); pCVar11 != (CParticleCollection *)0x0
; pCVar11 = *(CParticleCollection **)(pCVar11 + 0x70)) {
*(undefined4 *)(pCVar11 + 0x370) = 0;
*(undefined4 *)(pCVar11 + 0x374) = *(undefined4 *)(this + 0x374);
Simulate(pCVar11,param_1);
*(undefined4 *)(pCVar11 + 0x374) = 0;
}
if ((iVar2 == 0) && (iVar2 = *(int *)(this + 0x374), iVar2 != 0)) {
if (iVar2 == g_pKillBuffers) {
iVar5 = 0;
LAB_00bce78e:
*(undefined4 *)(this + 0x374) = 0;
(&g_nKillBufferInUse)[iVar5] = 0;
}
else {
iVar5 = 1;
do {
if (iVar2 == (&g_pKillBuffers)[iVar5]) goto LAB_00bce78e;
iVar5 = iVar5 + 1;
} while (iVar5 != 0x10);
}
}
UpdatePrevControlPoints(this,param_1);
BloatBoundsUsingControlPoint(this);
if (*(float *)(*(int *)(this + 0x48) + 0x2f4) <= *(float *)(this + 0x24) &&
*(float *)(this + 0x24) != *(float *)(*(int *)(this + 0x48) + 0x2f4)) {
this[0x58] = (CParticleCollection)0x1;
}
iVar2 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar5 = ThreadGetCurrentId(), iVar2 == iVar5)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = *(CParticleCollection **)(_DAT_0105d15c + 100);
}
DAT_0105d158 = _DAT_0105d15c == (CParticleCollection *)0x105d160;
}
if (local_20 == (CParticleCollection *)0x0) {
return;
}
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
return;
}
}
}
iVar2 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar5 = ThreadGetCurrentId(), iVar2 == iVar5)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = *(CParticleCollection **)(_DAT_0105d15c + 100);
}
DAT_0105d158 = _DAT_0105d15c == (CParticleCollection *)0x105d160;
}
if (local_20 != (CParticleCollection *)0x0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
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.