L L4D2node

CDirector::GetClosestActivePipeBomb

0x00875420 · 264 bytes · __thiscall

_ZNK9CDirector24GetClosestActivePipeBombERK6Vector

Decompiled

undefined (2 params)

/* CDirector::GetClosestActivePipeBomb(Vector const&) const */

CBaseEntity * __thiscall CDirector::GetClosestActivePipeBomb(CDirector *this,Vector *param_1)

{
  uint uVar1;
  CBaseEntity *this_00;
  undefined *puVar2;
  int iVar3;
  float fVar4;
  float fVar5;
  CBaseEntity *local_20;
  
  if (*(int *)(this + 0x460) < 1) {
    local_20 = (CBaseEntity *)0x0;
  }
  else {
    iVar3 = 0;
    local_20 = (CBaseEntity *)0x0;
    fVar5 = 3.4028235e+38;
    do {
      while ((((uVar1 = *(uint *)(*(int *)(this + 0x454) + iVar3 * 4), uVar1 != 0xffffffff &&
               (puVar2 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar2 != (undefined *)0xfffffffc))
              && (*(uint *)(puVar2 + 8) == uVar1 >> 0xc)) &&
             (this_00 = *(CBaseEntity **)(puVar2 + 4), this_00 != (CBaseEntity *)0x0))) {
        if (((byte)this_00[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(this_00);
        }
        fVar4 = (*(float *)(this_00 + 0x2e4) - *(float *)(param_1 + 4)) *
                (*(float *)(this_00 + 0x2e4) - *(float *)(param_1 + 4)) +
                (*(float *)(this_00 + 0x2e8) - *(float *)(param_1 + 8)) *
                (*(float *)(this_00 + 0x2e8) - *(float *)(param_1 + 8)) +
                (*(float *)(this_00 + 0x2e0) - *(float *)param_1) *
                (*(float *)(this_00 + 0x2e0) - *(float *)param_1);
        if (fVar5 <= fVar4) break;
        iVar3 = iVar3 + 1;
        fVar5 = fVar4;
        local_20 = this_00;
        if (*(int *)(this + 0x460) <= iVar3) {
          return this_00;
        }
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < *(int *)(this + 0x460));
  }
  return local_20;
}

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)