L L4D2node

CEnvAirStrikeOutdoorEffect::CrumbleThink

0x0066e6f0 · 942 bytes · __thiscall

_ZN26CEnvAirStrikeOutdoorEffect12CrumbleThinkEv

Decompiled

undefined (1 param)

/* CEnvAirStrikeOutdoorEffect::CrumbleThink() */

void __thiscall CEnvAirStrikeOutdoorEffect::CrumbleThink(CEnvAirStrikeOutdoorEffect *this)

{
  float fVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  char *pcVar4;
  char *pcVar5;
  CBaseEntity *this_00;
  uint *puVar6;
  uint uVar7;
  CBaseEntity *pCVar8;
  
  if (*(float *)(this + 0x13f4) <= *(float *)(gpGlobals + 0xc)) {
    iVar3 = *(int *)(this + 0x1404);
    if (iVar3 == 3) {
      CBaseEntity::EmitSound((CBaseEntity *)this,"BaseExplosionEffect.Sound",0.0,(float *)0x0);
      fVar1 = *(float *)(gpGlobals + 0xc);
      *(int *)(this + 0x1404) = *(int *)(this + 0x1404) + 1;
      *(float *)(this + 0x13f4) = fVar1 + 10.0;
    }
    else {
      if (iVar3 == 4) {
        CBaseEntity::SUB_FadeOut((CBaseEntity *)this);
        pCVar8 = (CBaseEntity *)0x0;
        while( true ) {
          pcVar5 = *(char **)(this + 0x13f8);
          if (pcVar5 == (char *)0x0) {
            pcVar5 = "";
          }
          pCVar8 = (CBaseEntity *)
                   CGlobalEntityList::FindEntityByName
                             ((CGlobalEntityList *)gEntList,pCVar8,pcVar5,(CBaseEntity *)0x0,
                              (CBaseEntity *)0x0,(CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
          if (pCVar8 == (CBaseEntity *)0x0) break;
          iVar3 = (**(code **)(*(int *)pCVar8 + 0xf0))(pCVar8);
          if (iVar3 != 0) {
            CBaseEntity::SUB_FadeOut((CBaseEntity *)this);
          }
        }
        return;
      }
      if (iVar3 == 1) {
        if (((byte)this[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
        }
        UTIL_ScreenShake(this + 0x2e0,0x41c80000,0x43020000,0x3f800000,0x44e10000,0,0,0);
        CBaseEntity::EmitSound((CBaseEntity *)this,"bombing.close_explos",0.0,(float *)0x0);
        fVar1 = *(float *)(gpGlobals + 0xc);
        *(int *)(this + 0x1404) = *(int *)(this + 0x1404) + 2;
        *(float *)(this + 0x13f4) = fVar1 + 2.0;
        uVar7 = *(uint *)(this + 0xd4) & 0xffffffdf;
        if (*(uint *)(this + 0xd4) == uVar7) {
          puVar6 = *(uint **)(this + 0x30);
        }
        else {
          if (this[0x6c] == (CEnvAirStrikeOutdoorEffect)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            puVar6 = (uint *)0x0;
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar3 + 2) = 0;
              puVar6 = *(uint **)(this + 0x30);
            }
          }
          else {
            this[0x70] = (CEnvAirStrikeOutdoorEffect)((byte)this[0x70] | 1);
            puVar6 = *(uint **)(this + 0x30);
          }
          *(uint *)(this + 0xd4) = uVar7;
        }
        if (puVar6 != (uint *)0x0) {
          *puVar6 = *puVar6 | 0x80;
        }
        CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
        iVar3 = (**(code **)(*random_valve + 8))(random_valve,0,1);
        if (iVar3 == 0) {
          pcVar5 = *(char **)(this + 0x1400);
        }
        else {
          pcVar5 = *(char **)(this + 0x13fc);
        }
        pcVar4 = "";
        if (pcVar5 != (char *)0x0) {
          pcVar4 = pcVar5;
        }
        iVar3 = CBaseAnimating::LookupSequence((CBaseAnimating *)this,pcVar4);
        if (-1 < iVar3) {
          CBaseAnimating::ResetSequence((CBaseAnimating *)this,iVar3);
        }
        pCVar8 = (CBaseEntity *)0x0;
        while( true ) {
          pcVar5 = *(char **)(this + 0x13f8);
          if (pcVar5 == (char *)0x0) {
            pcVar5 = "";
          }
          pCVar8 = (CBaseEntity *)
                   CGlobalEntityList::FindEntityByName
                             ((CGlobalEntityList *)gEntList,pCVar8,pcVar5,(CBaseEntity *)0x0,
                              (CBaseEntity *)0x0,(CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
          if (pCVar8 == (CBaseEntity *)0x0) break;
          this_00 = (CBaseEntity *)(**(code **)(*(int *)pCVar8 + 0xf0))(pCVar8);
          if (this_00 != (CBaseEntity *)0x0) {
            uVar7 = *(uint *)(this_00 + 0xd4) & 0xffffffdf;
            if (*(uint *)(this_00 + 0xd4) == uVar7) {
              puVar6 = *(uint **)(this_00 + 0x30);
            }
            else {
              if (this_00[0x6c] == (CBaseEntity)0x0) {
                pCVar2 = *(CBaseEdict **)(this_00 + 0x30);
                puVar6 = (uint *)0x0;
                if (pCVar2 != (CBaseEdict *)0x0) {
                  *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
                  iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
                  *(undefined2 *)(iVar3 + 2) = 0;
                  puVar6 = *(uint **)(this_00 + 0x30);
                }
              }
              else {
                this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
                puVar6 = *(uint **)(this_00 + 0x30);
              }
              *(uint *)(this_00 + 0xd4) = uVar7;
            }
            if (puVar6 != (uint *)0x0) {
              *puVar6 = *puVar6 | 0x80;
            }
            CBaseEntity::DispatchUpdateTransmitState(this_00);
            iVar3 = CBaseAnimating::LookupSequence((CBaseAnimating *)this_00,pcVar4);
            if (-1 < iVar3) {
              CBaseAnimating::ResetSequence((CBaseAnimating *)this_00,iVar3);
            }
          }
        }
      }
    }
  }
  if (((byte)this[0xd4] & 0x20) == 0) {
    (**(code **)(*(int *)this + 0x32c))(this);
    (**(code **)(*(int *)this + 0x364))(this,this);
  }
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.05,(char *)0x0);
  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)