L L4D2node

CEntityDissolve::DissolveThink

0x00677cb0 · 496 bytes · __thiscall

_ZN15CEntityDissolve13DissolveThinkEv

Decompiled

undefined (1 param)

/* CEntityDissolve::DissolveThink() */

void __thiscall CEntityDissolve::DissolveThink(CEntityDissolve *this)

{
  int *piVar1;
  CBaseEdict *this_00;
  CBaseEntity *this_01;
  CBaseEntity *pCVar2;
  uint uVar3;
  int iVar4;
  undefined *puVar5;
  float fVar6;
  int local_80;
  CTakeDamageInfo local_7c [108];
  
  uVar3 = *(uint *)(this + 0x188);
  if ((((uVar3 == 0xffffffff) ||
       (puVar5 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar5 + 8) != uVar3 >> 0xc)) ||
     (piVar1 = *(int **)(puVar5 + 4), piVar1 == (int *)0x0)) {
    (**(code **)(*(int *)this + 0x20))(&local_80,this);
    if (local_80 == 0) {
      return;
    }
  }
  else {
    this_01 = (CBaseEntity *)(**(code **)(*piVar1 + 0xf0))(piVar1);
    (**(code **)(*(int *)this + 0x20))(&local_80,this);
    if (local_80 == 0) {
      if (this_01 == (CBaseEntity *)0x0) {
        return;
      }
    }
    else if (this_01 == (CBaseEntity *)0x0) goto LAB_00677e13;
    CBaseEntity::SetCollisionGroup(this_01,0x10);
    if ((((byte)this_01[0x153] & 0x20) != 0) && (this[0x127] != (CEntityDissolve)0x0)) {
      if (this[0x6c] == (CEntityDissolve)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CEntityDissolve)((byte)this[0x70] | 1);
      }
      this[0x127] = (CEntityDissolve)0x0;
    }
    fVar6 = *(float *)(gpGlobals + 0xc) - *(float *)(this + 0x440);
    if (fVar6 < *(float *)(this + 0x444)) {
      CBaseEntity::SetNextThink
                ((CBaseEntity *)this,*(float *)(this + 0x440) + *(float *)(this + 0x444),(char *)0x0
                );
      return;
    }
    if (fVar6 < *(float *)(this + 0x458) + *(float *)(this + 0x454)) {
      CBaseEntity::SetNextThink
                ((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + *(float *)(gpGlobals + 0x1c),
                 (char *)0x0);
      return;
    }
    pCVar2 = (CBaseEntity *)UTIL_PlayerByIndex(1);
    uVar3 = (**(code **)(*g_pGameRules + 100))(g_pGameRules);
    CTakeDamageInfo::CTakeDamageInfo(local_7c,pCVar2,pCVar2,10000.0,uVar3 | 0x400000,0);
    CBaseEntity::TakeDamage(this_01,local_7c);
    if (this_01 != pCVar2) {
      UTIL_Remove(this_01);
    }
  }
LAB_00677e13:
  UTIL_Remove((CBaseEntity *)this);
  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)