L L4D2node

CEntityFlame::FlameThink

0x00679970 · 1944 bytes · __thiscall

_ZN12CEntityFlame10FlameThinkEv

Decompiled

undefined (1 param)

/* CEntityFlame::FlameThink() */

void __thiscall CEntityFlame::FlameThink(CEntityFlame *this)

{
  Vector *pVVar1;
  uint uVar2;
  CBaseEdict *this_00;
  char cVar3;
  int *piVar4;
  float *pfVar5;
  CBaseEntity *pCVar6;
  undefined *puVar7;
  int iVar8;
  CEntityFlame *pCVar9;
  float fVar10;
  undefined4 uVar11;
  undefined4 uVar12;
  undefined4 uVar13;
  undefined4 uVar14;
  undefined1 local_94 [12];
  float local_88;
  float local_84;
  float local_80;
  float local_7c;
  float local_78;
  float local_74;
  
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.2,(char *)0x0);
  uVar2 = *(uint *)(this + 0x440);
  if ((((uVar2 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)) {
    UTIL_Remove((CBaseEntity *)this);
    return;
  }
  if ((*(byte *)(*(int *)(puVar7 + 4) + 0x153) & 0x20) != 0) {
    if (this[0x127] == (CEntityFlame)0x0) {
      return;
    }
    if (this[0x6c] == (CEntityFlame)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar8 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar8 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CEntityFlame)((byte)this[0x70] | 1);
    }
    this[0x127] = (CEntityFlame)0x0;
    return;
  }
  piVar4 = (int *)CBaseEntity::MyNPCPointer();
  if ((piVar4 != (int *)0x0) && (cVar3 = (**(code **)(*piVar4 + 300))(piVar4), cVar3 == '\0')) {
    UTIL_Remove((CBaseEntity *)this);
    (**(code **)(*piVar4 + 0x38c))(piVar4);
    return;
  }
  uVar2 = *(uint *)(this + 0x440);
  if ((uVar2 == 0xffffffff) ||
     (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) {
    piVar4 = (int *)0x0;
    if (DAT_00000253 != '\0') goto LAB_00679ac8;
  }
  else {
    if (*(uint *)(puVar7 + 8) == uVar2 >> 0xc) {
      iVar8 = *(int *)(puVar7 + 4);
    }
    else {
      iVar8 = 0;
    }
    if (*(char *)(iVar8 + 0x253) != '\0') {
      if (*(uint *)(puVar7 + 8) == uVar2 >> 0xc) {
        piVar4 = *(int **)(puVar7 + 4);
      }
      else {
        piVar4 = (int *)0x0;
      }
LAB_00679ac8:
      pfVar5 = (float *)(**(code **)(*piVar4 + 0x288))(piVar4);
      piVar4 = (int *)0x0;
      local_88 = *pfVar5;
      local_84 = pfVar5[1];
      local_80 = pfVar5[2];
      uVar2 = *(uint *)(this + 0x440);
      if (((uVar2 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
        piVar4 = *(int **)(puVar7 + 4);
      }
      local_7c = local_88;
      local_78 = local_84;
      local_74 = local_80;
      iVar8 = (**(code **)(*piVar4 + 0x288))(piVar4);
      local_74 = *(float *)(iVar8 + 8);
      local_7c = local_7c + 32.0;
      local_78 = local_78 + 32.0;
      local_80 = local_80 - 32.0;
      local_88 = local_88 - 32.0;
      local_84 = local_84 - 32.0;
      UTIL_Bubbles((Vector *)&local_88,(Vector *)&local_7c,0xc);
    }
  }
  if (((*(float *)(this + 0x458) <= *(float *)(gpGlobals + 0xc) &&
        *(float *)(gpGlobals + 0xc) != *(float *)(this + 0x458)) ||
      (uVar2 = *(uint *)(this + 0x440), uVar2 == 0xffffffff)) ||
     ((puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc ||
      ((*(uint *)(puVar7 + 8) != uVar2 >> 0xc ||
       (pCVar6 = *(CBaseEntity **)(puVar7 + 4), pCVar6 == (CBaseEntity *)0x0)))))) {
    if (*(char **)(this + 0x45c) != (char *)0x0) {
      CBaseEntity::StopSound((CBaseEntity *)this,*(char **)(this + 0x45c));
      *(undefined4 *)(this + 0x45c) = 0;
    }
    uVar14 = 0;
    uVar13 = 0;
    uVar12 = 0;
    CBaseEntity::ThinkSet((_func_void *)local_94,(float)this,(char *)CBaseEntity::SUB_Remove);
    uVar11 = 0;
    fVar10 = *(float *)(gpGlobals + 0xc) + 0.5;
    CBaseEntity::SetNextThink((CBaseEntity *)this,fVar10,(char *)0x0);
    uVar2 = *(uint *)(this + 0x440);
    if ((((uVar2 != 0xffffffff) &&
         (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) &&
       ((piVar4 = *(int **)(puVar7 + 4), piVar4 != (int *)0x0 &&
        (piVar4 = (int *)(**(code **)(*piVar4 + 0x144))(piVar4,fVar10,uVar11,uVar12,uVar13,uVar14),
        piVar4 != (int *)0x0)))) {
      (**(code **)(*piVar4 + 0x38c))(piVar4);
      return;
    }
    return;
  }
  uVar2 = *(uint *)(this + 0x460);
  pCVar9 = this;
  if (((uVar2 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar7 + 8) == uVar2 >> 0xc &&
      (pCVar9 = (CEntityFlame *)*(CBaseEntity **)(puVar7 + 4),
      *(CBaseEntity **)(puVar7 + 4) == (CBaseEntity *)0x0)))) {
    pCVar9 = this;
  }
  cVar3 = (**(code **)(*(int *)pCVar6 + 0x16c))(pCVar6);
  if (cVar3 != '\0') {
    iVar8 = CBaseEntity::GetTeamNumber(pCVar6);
    if ((iVar8 == 3) && (iVar8 = (**(code **)(*(int *)pCVar6 + 0x544))(pCVar6), iVar8 == 3)) {
      uVar2 = *(uint *)(pCVar6 + 0x3e64);
    }
    else {
      iVar8 = CBaseEntity::GetTeamNumber(pCVar6);
      if ((iVar8 == 3) && (iVar8 = (**(code **)(*(int *)pCVar6 + 0x544))(pCVar6), iVar8 == 5)) {
        uVar2 = *(uint *)(pCVar6 + 0x3edc);
      }
      else {
        iVar8 = CBaseEntity::GetTeamNumber(pCVar6);
        if ((iVar8 != 3) || (iVar8 = (**(code **)(*(int *)pCVar6 + 0x544))(pCVar6), iVar8 != 6))
        goto LAB_00679db0;
        uVar2 = *(uint *)(pCVar6 + 0x3e44);
      }
    }
    if (((uVar2 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
      pCVar6 = *(CBaseEntity **)(puVar7 + 4);
      goto LAB_00679db2;
    }
  }
LAB_00679db0:
  pCVar6 = (CBaseEntity *)0x0;
LAB_00679db2:
  fVar10 = *(float *)(this + 0x448);
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  pVVar1 = (Vector *)(this + 0x2e0);
  CTakeDamageInfo::CTakeDamageInfo
            ((CTakeDamageInfo *)&local_7c,(CBaseEntity *)this,(CBaseEntity *)pCVar9,4.0,8,0);
  RadiusDamage((CTakeDamageInfo *)&local_7c,pVVar1,fVar10 * 0.5,0,pCVar6);
  CTakeDamageInfo::CTakeDamageInfo
            ((CTakeDamageInfo *)&local_7c,(CBaseEntity *)this,(CBaseEntity *)pCVar9,
             *(float *)(this + 0x484) * 0.2,0x10000008,*(int *)(this + 0x488));
  uVar2 = *(uint *)(this + 0x440);
  pCVar6 = (CBaseEntity *)0x0;
  if (((uVar2 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
    pCVar6 = *(CBaseEntity **)(puVar7 + 4);
  }
  CBaseEntity::TakeDamage(pCVar6,(CTakeDamageInfo *)&local_7c);
  uVar2 = *(uint *)(this + 0x440);
  piVar4 = (int *)0x0;
  if (((uVar2 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
    piVar4 = *(int **)(puVar7 + 4);
  }
  cVar3 = (**(code **)(*piVar4 + 0x140))(piVar4);
  if ((cVar3 == '\0') && (*(int *)(hl2_episodic._28_4_ + 0x30) != 0)) {
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    CSoundEnt::InsertSound(0x1000,pVVar1,0x18,0.1,(CBaseEntity *)this,2,(CBaseEntity *)0x0);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    local_7c = *(float *)(this + 0x2e0);
    local_78 = *(float *)(this + 0x2e4);
    local_74 = *(float *)(this + 0x2e8) + 48.0;
    CSoundEnt::InsertSound
              (0x1000,(Vector *)&local_7c,0x18,0.1,(CBaseEntity *)this,1,(CBaseEntity *)0x0);
  }
  fVar10 = *(float *)(this + 0x448);
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  FireSystem_AddHeatInRadius(pVVar1,fVar10 * 0.5,2.0);
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)