L L4D2node

CBaseEntity::SUB_Vanish

0x0060bda0 · 459 bytes · __thiscall

_ZN11CBaseEntity10SUB_VanishEv

Decompiled

undefined (1 param)

/* CBaseEntity::SUB_Vanish() */

void __thiscall CBaseEntity::SUB_Vanish(CBaseEntity *this)

{
  CBasePlayer *this_00;
  float *pfVar1;
  int iVar2;
  float fVar3;
  undefined1 local_44 [16];
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  iVar2 = 1;
  SetNextThink(this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
      this_00 = (CBasePlayer *)UTIL_PlayerByIndex(iVar2);
      if (this_00 != (CBasePlayer *)0x0) {
        pfVar1 = (float *)(**(code **)(*(int *)this_00 + 0x288))(this_00);
        if (((byte)this[0x14d] & 8) != 0) {
          CalcAbsolutePosition(this);
        }
        local_34 = *(float *)(this + 0x2e0) - *pfVar1;
        local_30 = *(float *)(this + 0x2e4) - pfVar1[1];
        local_2c = *(float *)(this + 0x2e8) - pfVar1[2];
        fVar3 = local_34 * local_34 + local_30 * local_30 + local_2c * local_2c;
        if (fVar3 < 65536.0) {
          return;
        }
        if (fVar3 < 2.25e+06) {
          VectorNormalize((Vector *)&local_34);
          CBasePlayer::EyeVectors(this_00,(Vector *)&local_28,(Vector *)0x0,(Vector *)0x0);
          if (0.0 < local_30 * local_24 + local_34 * local_28 + local_2c * local_20) {
            return;
          }
        }
      }
      iVar2 = iVar2 + 1;
    } while (iVar2 <= *(int *)(gpGlobals + 0x14));
  }
  if (*(int *)(this + 0x100) != 0) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    *(undefined4 *)(this + 0x100) = 0;
  }
  ThinkSet((_func_void *)local_44,(float)this,(char *)SUB_Remove);
  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)