CInferno::CreateFire
0x008c7d30 · 4024 bytes · __thiscall
_ZN8CInferno10CreateFireERK6VectorS2_PNS_8FireInfoEi
Decompiled
undefined (5 params)
/* CInferno::CreateFire(Vector const&, Vector const&, CInferno::FireInfo*, int) */
undefined4 __thiscall
CInferno::CreateFire(CInferno *this,Vector *param_1,Vector *param_2,FireInfo *param_3,int param_4)
{
Vector *pVVar1;
Vector *pVVar2;
Vector *pVVar3;
CInferno *__s1;
float fVar4;
float fVar5;
float fVar6;
float fVar7;
float fVar8;
CInferno CVar9;
CBaseEdict *pCVar10;
bool bVar11;
char cVar12;
undefined4 uVar13;
uint uVar14;
Vector *pVVar15;
int iVar16;
int iVar17;
int in_GS_OFFSET;
longdouble lVar18;
longdouble lVar19;
float fVar20;
float local_200;
Vector *local_1fc;
float local_1f0;
undefined4 local_1e8;
undefined4 local_1e4;
float local_1e0;
CTraceFilterSimple local_1dc [16];
undefined **local_1cc;
undefined4 local_1c8;
undefined4 local_1c4;
undefined4 local_1bc;
float local_1b8;
float local_1b4;
undefined4 local_1ac;
undefined4 local_1a8;
undefined4 local_1a4;
undefined4 local_19c;
undefined4 local_198;
undefined4 local_194;
undefined4 local_18c;
undefined1 local_188;
undefined1 local_187;
Vector local_170 [12];
undefined4 local_164;
undefined4 local_160;
float local_15c;
char local_13a;
int local_11c;
undefined4 local_118;
float local_114;
Vector local_110 [4];
undefined4 local_10c;
undefined4 local_108;
Vector *local_104;
undefined4 local_fc;
undefined4 local_f8;
undefined4 local_f4;
undefined4 local_f0;
undefined4 local_ec;
undefined4 local_e8;
undefined4 local_e4;
undefined4 local_e0;
undefined4 local_dc;
undefined1 local_d8;
undefined1 local_d7;
undefined4 local_c8;
undefined4 local_c4;
undefined4 local_c0;
undefined4 local_bc;
undefined4 local_b8;
undefined4 local_b4;
undefined1 local_b0;
undefined4 local_ac;
undefined1 local_a8;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar17 = 0x40;
if (*(int *)(this + 0xba4) < 0x41) {
iVar17 = *(int *)(this + 0xba4);
}
if ((iVar17 <= *(int *)(this + 0xa40)) ||
(cVar12 = IsTouching(this,param_1,param_1,(Vector *)0x0), cVar12 != '\0')) {
LAB_008c7d77:
uVar13 = 0;
goto LAB_008c7d79;
}
if ((*(int *)(InfernoDebug._28_4_ + 0x30) != 0) && (param_3 != (FireInfo *)0x0)) {
NDebugOverlay::Line((Vector *)param_3,param_1,0,0xff,0xff,true,10.0);
}
local_1e8 = *(undefined4 *)param_1;
local_1e4 = *(undefined4 *)(param_1 + 4);
local_1e0 = *(float *)(param_1 + 8);
uVar14 = (**(code **)*enginetrace)(enginetrace,param_1,0x4030,0);
if ((uVar14 & 0x30) == 0) {
bVar11 = false;
}
else {
if ((*(char **)(this + 0x7c) == "insect_swarm") ||
(cVar12 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)this,"insect_swarm"),
cVar12 != '\0')) {
local_114 = 60.0;
}
else {
local_114 = 30.0;
}
local_11c = *(int *)param_1;
local_114 = local_114 + *(float *)(param_1 + 8);
local_118 = *(undefined4 *)(param_1 + 4);
local_104 = (Vector *)(*(float *)(param_1 + 8) - local_114);
local_10c = 0;
local_108 = 0;
local_e4 = 0;
local_e8 = 0;
local_ec = 0;
local_d7 = (float)local_104 * (float)local_104 != 0.0;
local_f4 = 0;
local_f8 = 0;
local_fc = 0;
local_dc = 0;
local_d8 = 1;
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)&local_1cc,(IHandleEntity *)0x0,0,
(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))
(enginetrace,&local_11c,0x403b,(CTraceFilterSimple *)&local_1cc,local_170);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_170,(Vector *)&local_164,0xff,0,0,true,-1.0);
}
if (local_13a != '\0') goto LAB_008c7d77;
bVar11 = true;
local_1e8 = local_164;
local_1e4 = local_160;
local_1e0 = local_15c;
}
local_1fc = (Vector *)&local_11c;
pVVar15 = ::operator_new(0x58);
*(undefined ***)(pVVar15 + 0x30) = &PTR_NetworkStateChanged_00c0b6e0;
*(undefined4 *)pVVar15 = local_1e8;
pVVar1 = pVVar15 + 0x30;
*(undefined4 *)(pVVar15 + 4) = local_1e4;
pVVar2 = pVVar15 + 0x3c;
*(undefined4 *)(pVVar15 + 0x34) = 0;
*(float *)(pVVar15 + 8) = local_1e0;
*(undefined4 *)(pVVar15 + 0x38) = 0xbf800000;
*(undefined ***)(pVVar15 + 0x3c) = &PTR_NetworkStateChanged_00c0b6e0;
*(undefined4 *)(pVVar15 + 0x40) = 0;
*(undefined4 *)(pVVar15 + 0x44) = 0xbf800000;
*(undefined ***)(pVVar15 + 0x48) = &PTR_NetworkStateChanged_00c0b6e0;
*(undefined4 *)(pVVar15 + 0x4c) = 0;
*(undefined4 *)(pVVar15 + 0x50) = 0xbf800000;
fVar20 = *(float *)(this + 0xb4c);
*(undefined4 *)(pVVar15 + 0xc) = local_1e8;
pVVar3 = pVVar15 + 0x48;
*(undefined4 *)(pVVar15 + 0x10) = local_1e4;
*(float *)(pVVar15 + 0x14) = fVar20 * 0.5 + local_1e0;
*(undefined4 *)(pVVar15 + 0x18) = *(undefined4 *)param_2;
*(undefined4 *)(pVVar15 + 0x1c) = *(undefined4 *)(param_2 + 4);
uVar13 = *(undefined4 *)(param_2 + 8);
*(undefined4 *)(pVVar15 + 0x28) = 0;
*(undefined4 *)(pVVar15 + 0x20) = uVar13;
*(FireInfo **)(pVVar15 + 0x2c) = param_3;
*(int *)(pVVar15 + 0x24) = param_4;
*(float *)(pVVar15 + 0x54) = local_1e0 - *(float *)(param_1 + 8);
if (((((0 < param_4) && (*(int *)(this + 0xa44) == 1)) &&
(cVar12 = CTerrorGameRules::IsSurvivalMode(), cVar12 == '\0')) &&
((cVar12 = CTerrorGameRules::IsScavengeMode(), cVar12 == '\0' &&
(iVar17 = CNavMesh::GetNearestNavArea
(TheNavMesh,(Vector *)&local_1e8,false,10000.0,false,true,false),
iVar17 != 0)))) && ((*(byte *)(iVar17 + 0x12d) & 8) != 0)) {
*(undefined4 *)(pVVar15 + 0x24) = *(undefined4 *)(InfernoChildSpawnMaxDepth._28_4_ + 0x30);
}
if (*(float *)(this + 0xb9c) <= 0.0) {
lVar18 = (longdouble)(**(code **)(*(int *)this + 0x338))(this);
fVar20 = (float)lVar18;
lVar18 = (longdouble)CountdownTimer::Now();
if ((float)lVar18 + fVar20 != *(float *)(pVVar15 + 0x50)) {
(**(code **)(*(int *)(pVVar15 + 0x48) + 4))(pVVar3,pVVar15 + 0x50);
*(float *)(pVVar15 + 0x50) = (float)lVar18 + fVar20;
}
if (fVar20 != *(float *)(pVVar15 + 0x4c)) {
(**(code **)(*(int *)(pVVar15 + 0x48) + 4))(pVVar3,pVVar15 + 0x4c);
*(float *)(pVVar15 + 0x4c) = fVar20;
}
}
else {
lVar18 = (longdouble)(**(code **)(*(int *)this + 0x338))();
fVar20 = 99999.9;
if (0.0 < *(float *)(this + 0xb9c)) {
lVar19 = (longdouble)IntervalTimer::Now();
fVar20 = (float)lVar19 - *(float *)(this + 0xb9c);
}
fVar20 = (float)lVar18 - fVar20;
lVar18 = (longdouble)CountdownTimer::Now();
if ((float)lVar18 + fVar20 != *(float *)(pVVar15 + 0x50)) {
(**(code **)(*(int *)(pVVar15 + 0x48) + 4))(pVVar3,pVVar15 + 0x50);
*(float *)(pVVar15 + 0x50) = (float)lVar18 + fVar20;
}
if (fVar20 != *(float *)(pVVar15 + 0x4c)) {
(**(code **)(*(int *)(pVVar15 + 0x48) + 4))(pVVar3,pVVar15 + 0x4c);
*(float *)(pVVar15 + 0x4c) = fVar20;
}
}
if (param_3 == (FireInfo *)0x0) {
fVar20 = *(float *)(InfernoPerFlameSpawnDuration._28_4_ + 0x2c);
lVar18 = (longdouble)CountdownTimer::Now();
if ((float)lVar18 + fVar20 != *(float *)(pVVar15 + 0x38)) {
(**(code **)(*(int *)(pVVar15 + 0x30) + 4))(pVVar1,pVVar15 + 0x38);
*(float *)(pVVar15 + 0x38) = (float)lVar18 + fVar20;
}
if (fVar20 != *(float *)(pVVar15 + 0x34)) {
(**(code **)(*(int *)(pVVar15 + 0x30) + 4))(pVVar1,pVVar15 + 0x34);
*(float *)(pVVar15 + 0x34) = fVar20;
}
local_1f0 = *(float *)(InfernoInitialSpawnInterval._28_4_ + 0x2c);
lVar18 = (longdouble)CountdownTimer::Now();
if ((float)lVar18 + local_1f0 != *(float *)(pVVar15 + 0x44)) {
(**(code **)(*(int *)(pVVar15 + 0x3c) + 4))(pVVar2,pVVar15 + 0x44);
*(float *)(pVVar15 + 0x44) = (float)lVar18 + local_1f0;
}
if (local_1f0 != *(float *)(pVVar15 + 0x40)) goto LAB_008c8898;
}
else {
if (*(float *)(param_3 + 0x38) <= 0.0) {
local_200 = 0.0;
}
else {
local_200 = *(float *)(param_3 + 0x34);
}
lVar18 = (longdouble)CountdownTimer::Now();
if ((float)lVar18 + local_200 != *(float *)(pVVar15 + 0x38)) {
(**(code **)(*(int *)(pVVar15 + 0x30) + 4))(pVVar1,pVVar15 + 0x38);
*(float *)(pVVar15 + 0x38) = (float)lVar18 + local_200;
}
if (local_200 != *(float *)(pVVar15 + 0x34)) {
(**(code **)(*(int *)(pVVar15 + 0x30) + 4))(pVVar1,pVVar15 + 0x34);
*(float *)(pVVar15 + 0x34) = local_200;
}
if (*(float *)(param_3 + 0x44) <= 0.0) {
local_1f0 = 0.0;
}
else {
local_1f0 = *(float *)(InfernoChildSpawnIntervalMultiplier._28_4_ + 0x2c) *
*(float *)(param_3 + 0x40);
}
if (*(float *)(InfernoMaxChildSpawnInterval._28_4_ + 0x2c) <= local_1f0) {
local_1f0 = *(float *)(InfernoMaxChildSpawnInterval._28_4_ + 0x2c);
}
lVar18 = (longdouble)CountdownTimer::Now();
if ((float)lVar18 + local_1f0 != *(float *)(pVVar15 + 0x44)) {
(**(code **)(*(int *)(pVVar15 + 0x3c) + 4))(pVVar2,pVVar15 + 0x44);
*(float *)(pVVar15 + 0x44) = (float)lVar18 + local_1f0;
}
if (local_1f0 != *(float *)(pVVar15 + 0x40)) {
LAB_008c8898:
(**(code **)(*(int *)(pVVar15 + 0x3c) + 4))(pVVar2,pVVar15 + 0x40);
*(float *)(pVVar15 + 0x40) = local_1f0;
}
}
iVar17 = *(int *)(this + 0xa40);
*(Vector **)(this + iVar17 * 4 + 0xa48) = pVVar15;
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
iVar17 = *(int *)(this + 0xa40);
}
fVar20 = *(float *)pVVar15;
fVar4 = *(float *)(this + 0x2e0);
fVar5 = *(float *)(pVVar15 + 4);
fVar6 = *(float *)(pVVar15 + 8);
fVar7 = *(float *)(this + 0x2e4);
fVar8 = *(float *)(this + 0x2e8);
local_11c = (int)(fVar20 - fVar4);
iVar16 = memcmp(this + iVar17 * 4 + 0x440,local_1fc,4);
if (iVar16 == 0) {
CVar9 = this[0x6c];
}
else {
if (this[0x6c] == (CInferno)0x0) {
pCVar10 = *(CBaseEdict **)(this + 0x30);
CVar9 = (CInferno)0x0;
if (pCVar10 != (CBaseEdict *)0x0) {
*(uint *)pCVar10 = *(uint *)pCVar10 | 0x101;
iVar16 = CBaseEdict::GetChangeAccessor(pCVar10);
*(undefined2 *)(iVar16 + 2) = 0;
CVar9 = this[0x6c];
}
}
else {
this[0x70] = (CInferno)((byte)this[0x70] | 1);
CVar9 = (CInferno)0x1;
}
*(int *)(this + iVar17 * 4 + 0x440) = (int)(fVar20 - fVar4);
iVar17 = *(int *)(this + 0xa40);
}
local_11c = (int)(fVar5 - fVar7);
iVar16 = memcmp(this + iVar17 * 4 + 0x540,local_1fc,4);
if (iVar16 != 0) {
if (CVar9 == (CInferno)0x0) {
pCVar10 = *(CBaseEdict **)(this + 0x30);
if (pCVar10 != (CBaseEdict *)0x0) {
*(uint *)pCVar10 = *(uint *)pCVar10 | 0x101;
iVar16 = CBaseEdict::GetChangeAccessor(pCVar10);
*(undefined2 *)(iVar16 + 2) = 0;
CVar9 = this[0x6c];
}
}
else {
this[0x70] = (CInferno)((byte)this[0x70] | 1);
}
*(int *)(this + iVar17 * 4 + 0x540) = (int)(fVar5 - fVar7);
iVar17 = *(int *)(this + 0xa40);
}
local_11c = (int)(fVar6 - fVar8);
iVar16 = memcmp(this + iVar17 * 4 + 0x640,local_1fc,4);
if (iVar16 != 0) {
if (CVar9 == (CInferno)0x0) {
pCVar10 = *(CBaseEdict **)(this + 0x30);
if (pCVar10 != (CBaseEdict *)0x0) {
*(uint *)pCVar10 = *(uint *)pCVar10 | 0x101;
iVar16 = CBaseEdict::GetChangeAccessor(pCVar10);
*(undefined2 *)(iVar16 + 2) = 0;
CVar9 = this[0x6c];
}
}
else {
this[0x70] = (CInferno)((byte)this[0x70] | 1);
}
*(int *)(this + iVar17 * 4 + 0x640) = (int)(fVar6 - fVar8);
iVar17 = *(int *)(this + 0xa40);
}
__s1 = this + iVar17 * 0xc + 0x740;
iVar16 = memcmp(__s1,param_2,0xc);
if (iVar16 != 0) {
if (CVar9 == (CInferno)0x0) {
pCVar10 = *(CBaseEdict **)(this + 0x30);
if (pCVar10 != (CBaseEdict *)0x0) {
*(uint *)pCVar10 = *(uint *)pCVar10 | 0x101;
iVar17 = CBaseEdict::GetChangeAccessor(pCVar10);
*(undefined2 *)(iVar17 + 2) = 0;
}
}
else {
this[0x70] = (CInferno)((byte)this[0x70] | 1);
}
*(undefined4 *)__s1 = *(undefined4 *)param_2;
*(undefined4 *)(__s1 + 4) = *(undefined4 *)(param_2 + 4);
*(undefined4 *)(__s1 + 8) = *(undefined4 *)(param_2 + 8);
CVar9 = this[0x6c];
iVar17 = *(int *)(this + 0xa40);
}
if (CVar9 == (CInferno)0x0) {
pCVar10 = *(CBaseEdict **)(this + 0x30);
if (pCVar10 != (CBaseEdict *)0x0) {
*(uint *)pCVar10 = *(uint *)pCVar10 | 0x101;
iVar16 = CBaseEdict::GetChangeAccessor(pCVar10);
*(undefined2 *)(iVar16 + 2) = 0;
}
}
else {
this[0x70] = (CInferno)((byte)this[0x70] | 1);
}
*(int *)(this + 0xa40) = iVar17 + 1;
RecomputeExtent(this);
uVar13 = 1;
if (*(int *)(this + 0xa44) == 0) {
local_c8 = 0;
local_c4 = 0x3f800000;
local_c0 = 100;
local_bc = 100;
local_b8 = 100;
local_b4 = 0x4b;
local_a8 = 0;
local_b0 = 0;
local_ac = 0;
local_28 = 0;
local_24 = 0;
cVar12 = CBaseEntity::GetParametersForSound
("Inferno.Fire.Ignite",(CSoundParameters *)&local_c8,(char *)0x0);
if (cVar12 != '\0') {
EmitSound_t::EmitSound_t((EmitSound_t *)local_1fc,(CSoundParameters *)&local_c8);
local_104 = pVVar15;
/* try { // try from 008c8a3a to 008c8a3e has its CatchHandler @ 008c8d99 */
CRecipientFilter::CRecipientFilter((CRecipientFilter *)&local_1cc);
local_1cc = &PTR__CPASFilter_00bfaf28;
/* try { // try from 008c8a50 to 008c8a54 has its CatchHandler @ 008c8d8b */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)&local_1cc,pVVar15);
local_1cc = &PTR__CPASAttenuationFilter_00c08ec8;
/* try { // try from 008c8a6e to 008c8a72 has its CatchHandler @ 008c8d89 */
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)&local_1cc,pVVar15,0.8);
/* try { // try from 008c8a88 to 008c8a8c has its CatchHandler @ 008c8d3f */
CBaseEntity::EmitSound((IRecipientFilter *)&local_1cc,0,(EmitSound_t *)local_1fc);
local_1cc = &PTR__CPASFilter_00bfaf28;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)&local_1cc);
local_e4 = 0;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_f0);
local_e0 = local_f0;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_f0);
}
if ((*(int *)(inferno_scorch_decals._28_4_ + 0x30) != 0) && (!bVar11)) {
local_1bc = 0;
local_1b8 = *(float *)(pVVar15 + 4) - *(float *)(pVVar15 + 4);
local_1b4 = (*(float *)(pVVar15 + 8) - 100.0) - *(float *)(pVVar15 + 8);
local_188 = 1;
local_194 = 0;
local_198 = 0;
local_19c = 0;
local_18c = 0;
local_1a4 = 0;
local_1a8 = 0;
local_1ac = 0;
local_187 = local_1b4 * local_1b4 + local_1b8 * local_1b8 != 0.0;
local_1cc = *(undefined ***)pVVar15;
local_1c8 = *(undefined4 *)(pVVar15 + 4);
local_1c4 = *(undefined4 *)(pVVar15 + 8);
CTraceFilterSimple::CTraceFilterSimple
(local_1dc,(IHandleEntity *)0x0,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_1cc,0x4081,local_1dc,local_1fc);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_1fc,local_110,0xff,0,0,true,-1.0);
}
UTIL_DecalTrace((CGameTrace *)local_1fc,"MolotovScorch");
}
uVar13 = 1;
}
LAB_008c7d79:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return uVar13;
}
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.