L L4D2node

CSmokeStack::Activate

0x008247c0 · 1036 bytes · __thiscall

_ZN11CSmokeStack8ActivateEv

Decompiled

undefined (1 param)

/* CSmokeStack::Activate() */

void __thiscall CSmokeStack::Activate(CSmokeStack *this)

{
  float fVar1;
  undefined4 uVar2;
  CBaseEntity CVar3;
  CBaseEdict *pCVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  char *pcVar8;
  CBaseEntity *this_00;
  CSmokeStack *pCVar9;
  
  this_00 = (CBaseEntity *)0x0;
  CBaseEntity::DetectInSkybox((CBaseEntity *)this);
  do {
    do {
      this_00 = (CBaseEntity *)
                CGlobalEntityList::FindEntityByClassname
                          ((CGlobalEntityList *)gEntList,this_00,"env_particlelight");
      if (this_00 == (CBaseEntity *)0x0) {
        iVar6 = *(int *)(this + 0x464);
        if (*(char *)(iVar6 + 0x6c) == '\0') {
          pCVar4 = *(CBaseEdict **)(iVar6 + 0x30);
          if (pCVar4 != (CBaseEdict *)0x0) {
            *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
            iVar7 = CBaseEdict::GetChangeAccessor(pCVar4);
            *(undefined2 *)(iVar7 + 2) = 0;
          }
        }
        else {
          *(byte *)(iVar6 + 0x70) = *(byte *)(iVar6 + 0x70) | 1;
        }
        iVar7 = gpGlobals;
        uVar2 = *(undefined4 *)(gpGlobals + 0xc);
        *(undefined4 *)(iVar6 + 0x78) = 0;
        *(undefined4 *)(iVar6 + 0x74) = uVar2;
        iVar6 = *(int *)(this + 0x484);
        *(float *)(this + 0x474) = *(float *)(this + 0x474) * 0.003921569;
        *(float *)(this + 0x478) = *(float *)(this + 0x478) * 0.003921569;
        *(float *)(this + 0x47c) = *(float *)(this + 0x47c) * 0.003921569;
        if (*(char *)(iVar6 + 0x6c) == '\0') {
          pCVar4 = *(CBaseEdict **)(iVar6 + 0x30);
          if (pCVar4 != (CBaseEdict *)0x0) {
            *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
            iVar7 = CBaseEdict::GetChangeAccessor(pCVar4);
            *(undefined2 *)(iVar7 + 2) = 0;
            iVar7 = gpGlobals;
          }
        }
        else {
          *(byte *)(iVar6 + 0x70) = *(byte *)(iVar6 + 0x70) | 1;
        }
        uVar2 = *(undefined4 *)(iVar7 + 0xc);
        *(undefined4 *)(iVar6 + 0x78) = 0;
        *(undefined4 *)(iVar6 + 0x74) = uVar2;
        *(float *)(this + 0x494) = *(float *)(this + 0x494) * 0.003921569;
        *(float *)(this + 0x498) = *(float *)(this + 0x498) * 0.003921569;
        *(float *)(this + 0x49c) = *(float *)(this + 0x49c) * 0.003921569;
        CBaseParticleEntity::Activate((CBaseParticleEntity *)this);
        if ((*(int *)(this + 0x4ac) == -1) &&
           (iVar6 = CBaseEntity::PrecacheModel("particle/SmokeStack.vmt"),
           iVar6 != *(int *)(this + 0x4ac))) {
          if (this[0x6c] == (CSmokeStack)0x0) {
            pCVar4 = *(CBaseEdict **)(this + 0x30);
            if (pCVar4 != (CBaseEdict *)0x0) {
              *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar4);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CSmokeStack)((byte)this[0x70] | 1);
          }
          *(int *)(this + 0x4ac) = iVar6;
          return;
        }
        return;
      }
      pcVar8 = *(char **)(this_00 + 0x450);
      if (pcVar8 == (char *)0x0) {
        pcVar8 = "";
      }
      pcVar5 = "";
      if (*(char **)(this + 0x154) != (char *)0x0) {
        pcVar5 = *(char **)(this + 0x154);
      }
    } while ((pcVar8 != pcVar5) && (iVar6 = _V_stricmp(pcVar5,pcVar8), iVar6 != 0));
    fVar1 = *(float *)(this_00 + 0x440);
    pCVar9 = this + 0x464;
    if (this_00[0x454] != (CBaseEntity)0x0) {
      pCVar9 = this + 0x484;
    }
    if (fVar1 == *(float *)(pCVar9 + 0x1c)) {
      if (*(float *)(this_00 + 0x444) != *(float *)(pCVar9 + 0x10)) goto LAB_008249b8;
LAB_00824875:
      if ((*(float *)(this_00 + 0x448) != *(float *)(pCVar9 + 0x14)) ||
         (*(float *)(this_00 + 0x44c) != *(float *)(pCVar9 + 0x18))) goto LAB_008249b8;
      CVar3 = this_00[0x14d];
    }
    else {
      iVar6 = *(int *)pCVar9;
      if (*(char *)(iVar6 + 0x6c) == '\0') {
        pCVar4 = *(CBaseEdict **)(iVar6 + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar7 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar7 + 2) = 0;
        }
      }
      else {
        *(byte *)(iVar6 + 0x70) = *(byte *)(iVar6 + 0x70) | 1;
      }
      uVar2 = *(undefined4 *)(gpGlobals + 0xc);
      *(undefined4 *)(iVar6 + 0x78) = 0;
      *(undefined4 *)(iVar6 + 0x74) = uVar2;
      *(float *)(pCVar9 + 0x1c) = fVar1;
      if (*(float *)(this_00 + 0x444) == *(float *)(pCVar9 + 0x10)) goto LAB_00824875;
LAB_008249b8:
      iVar6 = *(int *)pCVar9;
      if (*(char *)(iVar6 + 0x6c) == '\0') {
        pCVar4 = *(CBaseEdict **)(iVar6 + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar7 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar7 + 2) = 0;
        }
      }
      else {
        *(byte *)(iVar6 + 0x70) = *(byte *)(iVar6 + 0x70) | 1;
      }
      uVar2 = *(undefined4 *)(gpGlobals + 0xc);
      *(undefined4 *)(iVar6 + 0x78) = 0;
      *(undefined4 *)(iVar6 + 0x74) = uVar2;
      *(int *)(pCVar9 + 0x10) = *(int *)(this_00 + 0x444);
      *(int *)(pCVar9 + 0x14) = *(int *)(this_00 + 0x448);
      *(int *)(pCVar9 + 0x18) = *(int *)(this_00 + 0x44c);
      CVar3 = this_00[0x14d];
    }
    if (((byte)CVar3 & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    if (((*(float *)(this_00 + 0x2e0) != *(float *)(pCVar9 + 4)) ||
        (*(float *)(this_00 + 0x2e4) != *(float *)(pCVar9 + 8))) ||
       (*(float *)(this_00 + 0x2e8) != *(float *)(pCVar9 + 0xc))) {
      iVar6 = *(int *)pCVar9;
      if (*(char *)(iVar6 + 0x6c) == '\0') {
        pCVar4 = *(CBaseEdict **)(iVar6 + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar7 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar7 + 2) = 0;
        }
      }
      else {
        *(byte *)(iVar6 + 0x70) = *(byte *)(iVar6 + 0x70) | 1;
      }
      uVar2 = *(undefined4 *)(gpGlobals + 0xc);
      *(undefined4 *)(iVar6 + 0x78) = 0;
      *(undefined4 *)(iVar6 + 0x74) = uVar2;
      *(int *)(pCVar9 + 4) = *(int *)(this_00 + 0x2e0);
      *(int *)(pCVar9 + 8) = *(int *)(this_00 + 0x2e4);
      *(int *)(pCVar9 + 0xc) = *(int *)(this_00 + 0x2e8);
    }
  } while( true );
}

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)