CFire::Update
0x006a0b30 · 2763 bytes · __thiscall
_ZN5CFire6UpdateEf
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CFire::Update(float) */
void __thiscall CFire::Update(CFire *this,float param_1)
{
float fVar1;
uint uVar2;
CBaseEntity *this_00;
undefined4 uVar3;
undefined4 uVar4;
char cVar5;
int iVar6;
int iVar7;
float *pfVar8;
float *pfVar9;
undefined *puVar10;
int *piVar11;
int iVar12;
bool bVar13;
float fVar14;
float fVar15;
float fVar16;
float fVar17;
int local_588;
uint local_570;
undefined4 local_564;
undefined4 local_560;
undefined4 local_55c;
undefined4 local_558;
int local_554;
float local_550;
float local_54c;
float local_548;
float local_544;
float local_540;
float local_53c;
float local_538;
float local_534;
float local_530;
float local_52c;
float local_528;
float local_524;
CTraceFilterSimple local_520 [16];
float afStack_510 [16];
CFlaggedEntitiesEnum local_4d0 [12];
Vector local_4c4 [32];
float local_4a4;
char local_499;
float local_47c;
float local_478;
float local_474;
float local_46c;
float local_468;
float local_464;
undefined4 local_45c;
undefined4 local_458;
undefined4 local_454;
undefined4 local_44c;
undefined4 local_448;
undefined4 local_444;
undefined4 local_43c;
undefined1 local_438;
undefined1 local_437;
CBaseEntity *local_41c [259];
local_564 = 0;
local_560 = 0;
if (___atan2f_finite == 0) {
local_554 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_564,0,0,0,0,"/data/src/game/server/fire.cpp",0x3a0,
&Update(float)::tm_fmt,"(%s)%s","Unaccounted","CFire::Update");
local_554 = ___atan2f_finite;
}
iVar7 = _DAT_0105db00;
local_55c = local_564;
local_558 = local_560;
/* try { // try from 006a0bfd to 006a0c01 has its CatchHandler @ 006a1616 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
if ((char *)*_DAT_0105d15c != "CFire::Update") {
/* try { // try from 006a14fd to 006a150e has its CatchHandler @ 006a1616 */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc85d83,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
if ((*(float *)(this + 0x44c) != 0.0) &&
(fVar14 = *(float *)(this + 0x44c) - param_1, *(float *)(this + 0x44c) = fVar14, fVar14 <= 0.0)
) {
/* try { // try from 006a1526 to 006a152a has its CatchHandler @ 006a15f2 */
GoOutInSeconds(this,1.0);
iVar7 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_554 == 0) {
return;
}
(**(code **)(local_554 + 0x54))(local_554,local_55c,local_558,0,0,0);
return;
}
fVar14 = *(float *)(this + 0x460);
if (fVar14 != *(float *)(this + 0x470)) {
uVar2 = *(uint *)(this + 0x440);
piVar11 = (int *)0x0;
*(float *)(this + 0x470) = fVar14;
if (((uVar2 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar2 >> 0xc)) {
piVar11 = *(int **)(puVar10 + 4);
}
/* try { // try from 006a0c9d to 006a0ff5 has its CatchHandler @ 006a15f2 */
(**(code **)(*piVar11 + 0x324))(piVar11,fVar14 * 0.015625,0x3f000000);
}
if (this[0x478] != (CFire)0x0) {
/* try { // try from 006a10d8 to 006a14a2 has its CatchHandler @ 006a15f2 */
AddHeat((float)this,true);
}
fVar1 = *(float *)(this + 0x460);
GetFireDimensions(this,(Vector *)&local_550,(Vector *)&local_544);
local_538 = local_550 * 0.5;
local_528 = local_540 * 0.5;
local_534 = local_54c * 0.5;
local_530 = local_548 * 0.5;
local_524 = local_53c * 0.5;
local_52c = local_544 * 0.5;
if (((byte)this[0x14d] & 8) == 0) {
fVar17 = *(float *)(this + 0x2e0);
fVar15 = *(float *)(this + 0x2e8);
local_550 = local_550 + fVar17;
local_548 = local_548 + fVar15;
fVar16 = *(float *)(this + 0x2e4);
local_54c = local_54c + fVar16;
LAB_006a0de4:
local_544 = local_544 + fVar17;
local_540 = local_540 + fVar16;
local_53c = local_53c + fVar15;
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
fVar17 = *(float *)(this + 0x2e0);
local_550 = local_550 + fVar17;
fVar16 = *(float *)(this + 0x2e4);
local_54c = local_54c + fVar16;
fVar15 = *(float *)(this + 0x2e8);
local_548 = local_548 + fVar15;
if ((*(uint *)(this + 0x14c) & 0x800) == 0) goto LAB_006a0de4;
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
fVar17 = *(float *)(this + 0x2e0);
fVar16 = *(float *)(this + 0x2e4);
local_544 = local_544 + fVar17;
fVar15 = *(float *)(this + 0x2e8);
local_540 = local_540 + fVar16;
local_53c = local_53c + fVar15;
if ((*(uint *)(this + 0x14c) & 0x800) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
fVar17 = *(float *)(this + 0x2e0);
fVar16 = *(float *)(this + 0x2e4);
local_538 = local_538 + fVar17;
fVar15 = *(float *)(this + 0x2e8);
local_534 = local_534 + fVar16;
local_530 = local_530 + fVar15;
if ((*(uint *)(this + 0x14c) & 0x800) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
fVar17 = *(float *)(this + 0x2e0);
fVar16 = *(float *)(this + 0x2e4);
fVar15 = *(float *)(this + 0x2e8);
}
goto LAB_006a0e44;
}
}
local_538 = local_538 + fVar17;
local_534 = local_534 + fVar16;
local_530 = local_530 + fVar15;
LAB_006a0e44:
local_52c = fVar17 + local_52c;
local_528 = fVar16 + local_528;
local_524 = fVar15 + local_524;
CFlaggedEntitiesEnum::CFlaggedEntitiesEnum(local_4d0,local_41c,0x100,0);
iVar7 = UTIL_EntitiesInBox((Vector *)&local_550,(Vector *)&local_544,local_4d0);
uVar4 = fire_dmgscale._28_4_;
uVar3 = fire_dmginterval._28_4_;
if (*(float *)(this + 0x450) <= *(float *)(gpGlobals + 0xc)) {
*(float *)(this + 0x450) =
*(float *)(gpGlobals + 0xc) + *(float *)(fire_dmginterval._28_4_ + 0x2c);
local_588 = (int)((*(float *)(uVar4 + 0x2c) * *(float *)(this + 0x468) *
fVar14 * 0.015625 * fVar1 + *(float *)(fire_dmgbase._28_4_ + 0x2c)) *
*(float *)(uVar3 + 0x2c));
bVar13 = local_588 != 0;
}
else {
local_588 = 0;
bVar13 = false;
}
iVar6 = *(int *)(this + 0x448);
if (0 < iVar7) {
iVar12 = 0;
local_570 = 0;
do {
while (this_00 = local_41c[iVar12], this == (CFire *)this_00) {
LAB_006a0f50:
iVar12 = iVar12 + 1;
if (iVar12 == iVar7) goto LAB_006a0f97;
}
if ((*(char **)(this_00 + 0x7c) != "env_fire") &&
(cVar5 = CBaseEntity::ClassMatchesComplex(this_00,"env_fire"), cVar5 == '\0')) {
if ((this_00[0x105] != (CBaseEntity)0x0) && (bVar13)) {
CCollisionProperty::CollisionAABBToWorldAABB
((CCollisionProperty *)(this_00 + 0x194),(Vector *)(this_00 + 0x19c),
(Vector *)(this_00 + 0x1a8),(Vector *)local_4d0,(Vector *)&local_47c);
cVar5 = IsBoxIntersectingBox
((Vector *)local_4d0,(Vector *)&local_47c,(Vector *)&local_538,
(Vector *)&local_52c);
if (cVar5 != '\0') {
pfVar8 = (float *)(**(code **)(*(int *)this_00 + 0x288))(this_00);
pfVar9 = (float *)(**(code **)(*(int *)this + 0x288))(this);
local_46c = *pfVar8 - *pfVar9;
local_468 = pfVar8[1] - pfVar9[1];
local_464 = pfVar8[2] - pfVar9[2];
local_438 = 1;
local_444 = 0;
local_448 = 0;
local_44c = 0;
local_43c = 0;
local_454 = 0;
local_458 = 0;
local_45c = 0;
local_437 = local_468 * local_468 + local_46c * local_46c + local_464 * local_464 != 0.0
;
local_47c = *pfVar9;
local_478 = pfVar9[1];
local_474 = pfVar9[2];
CTraceFilterSimple::CTraceFilterSimple
(local_520,(IHandleEntity *)this_00,0,(_func_bool_IHandleEntity_ptr_int *)0x0)
;
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_47c,0x4003,local_520,local_4d0);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine((Vector *)local_4d0,local_4c4,0xff,0,0,true,-1.0);
}
if ((local_4a4 == 1.0) && (local_499 == '\0')) {
CTakeDamageInfo::CTakeDamageInfo
((CTakeDamageInfo *)&local_47c,(CBaseEntity *)this,(CBaseEntity *)this,
(float)local_588,(-(uint)(iVar6 == 0) & 0xff000008) + 0x1000000,0);
CBaseEntity::TakeDamage(this_00,(CTakeDamageInfo *)&local_47c);
}
}
}
goto LAB_006a0f50;
}
if (0xf < local_570) goto LAB_006a0f50;
iVar12 = iVar12 + 1;
uVar2 = local_570 + 1;
afStack_510[local_570] = (float)this_00;
local_570 = uVar2;
} while (iVar12 != iVar7);
LAB_006a0f97:
if (local_570 != 0) {
iVar7 = 0;
do {
while (*(char *)((int)afStack_510[iVar7] + 0x478) == '\0') {
iVar7 = iVar7 + 1;
if ((int)local_570 <= iVar7) goto LAB_006a1001;
}
AddHeat(afStack_510[iVar7],false);
iVar7 = iVar7 + 1;
} while (iVar7 < (int)local_570);
}
}
LAB_006a1001:
iVar7 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_554 != 0) {
(**(code **)(local_554 + 0x54))(local_554,local_55c,local_558,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.