L L4D2node

CGlobalEntityList::FindEntityInSphere

0x0067c9d0 · 399 bytes · __thiscall

_ZN17CGlobalEntityList18FindEntityInSphereEP11CBaseEntityRK6Vectorf

Decompiled

undefined (4 params)

/* CGlobalEntityList::FindEntityInSphere(CBaseEntity*, Vector const&, float) */

int __thiscall
CGlobalEntityList::FindEntityInSphere
          (CGlobalEntityList *this,CBaseEntity *param_1,Vector *param_2,float param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  char cVar4;
  uint *puVar5;
  float *pfVar6;
  Vector *pVVar7;
  Vector *pVVar8;
  matrix3x4_t *pmVar9;
  Vector *local_30;
  float local_28;
  float local_24;
  float local_20;
  
  if (param_1 == (CBaseEntity *)0x0) {
    piVar2 = *(int **)(this + 0x10004);
  }
  else {
    puVar5 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    piVar2 = *(int **)(this + (*puVar5 & 0xfff) * 0x10 + 0x10);
  }
  do {
    if (piVar2 == (int *)0x0) {
      return 0;
    }
    iVar3 = *piVar2;
    if (iVar3 == 0) {
      DevWarning("NULL entity in global entity list!\n");
    }
    else if (*(int *)(iVar3 + 0x30) != 0) {
      iVar1 = iVar3 + 0x194;
      if ((((*(byte *)(iVar3 + 0x1b4) & 0x40) == 0) && ((*(byte *)(iVar3 + 0x1b6) & 0xfd) != 0)) &&
         ((pfVar6 = (float *)(**(code **)(*(int *)(iVar3 + 0x194) + 0x24))(iVar1),
          vec3_angle != *pfVar6 || ((DAT_01053d40 != pfVar6[1] || (DAT_01053d44 != pfVar6[2])))))) {
        pmVar9 = (matrix3x4_t *)(**(code **)(*(int *)(iVar3 + 0x194) + 0x28))(iVar1);
        VectorITransform((float *)param_2,pmVar9,&local_28);
      }
      else {
        pfVar6 = (float *)(**(code **)(*(int *)(iVar3 + 0x194) + 0x20))(iVar1);
        local_28 = *(float *)param_2 - *pfVar6;
        local_24 = *(float *)(param_2 + 4) - pfVar6[1];
        local_20 = *(float *)(param_2 + 8) - pfVar6[2];
      }
      local_30 = (Vector *)&local_28;
      pVVar7 = (Vector *)(**(code **)(*(int *)(iVar3 + 0x194) + 8))(iVar1);
      pVVar8 = (Vector *)(**(code **)(*(int *)(iVar3 + 0x194) + 4))(iVar1);
      cVar4 = IsBoxIntersectingSphere(pVVar8,pVVar7,local_30,param_3);
      if (cVar4 != '\0') {
        return iVar3;
      }
    }
    piVar2 = (int *)piVar2[3];
  } 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)