L L4D2node

IVision::GetClosestRecognized

0x0075b560 · 444 bytes · __thiscall

_ZNK7IVision20GetClosestRecognizedERK20INextBotEntityFilter

Decompiled

undefined (2 params)

/* IVision::GetClosestRecognized(INextBotEntityFilter const&) const */

undefined4 __thiscall IVision::GetClosestRecognized(IVision *this,INextBotEntityFilter *param_1)

{
  uint uVar1;
  char cVar2;
  int *piVar3;
  float *pfVar4;
  undefined *puVar5;
  int iVar6;
  float fVar7;
  undefined4 local_2c;
  float local_24;
  CBaseEntity *local_20;
  
  piVar3 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
  pfVar4 = (float *)(**(code **)(*piVar3 + 0xd4))(piVar3);
  if (0 < *(int *)(this + 0x38)) {
    iVar6 = 0;
    local_2c = 0;
    local_24 = (float)0x4e6e6b28;
    do {
      while ((((uVar1 = *(uint *)(*(int *)(this + 0x2c) + iVar6 * 0x14), uVar1 == 0xffffffff ||
               (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc))
              || (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) ||
             ((*(int *)(puVar5 + 4) == 0 ||
              (cVar2 = (*(code *)**(undefined4 **)param_1)(param_1,*(int *)(puVar5 + 4)),
              cVar2 == '\0'))))) {
LAB_0075b5b0:
        iVar6 = iVar6 + 1;
        if (*(int *)(this + 0x38) <= iVar6) {
          return local_2c;
        }
      }
      local_20 = (CBaseEntity *)0x0;
      uVar1 = *(uint *)(*(int *)(this + 0x2c) + iVar6 * 0x14);
      if ((uVar1 != 0xffffffff) &&
         ((puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc &&
          (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)))) {
        local_20 = *(CBaseEntity **)(puVar5 + 4);
      }
      if (((byte)local_20[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(local_20);
      }
      fVar7 = (*(float *)(local_20 + 0x2e4) - pfVar4[1]) *
              (*(float *)(local_20 + 0x2e4) - pfVar4[1]) +
              (*(float *)(local_20 + 0x2e0) - *pfVar4) * (*(float *)(local_20 + 0x2e0) - *pfVar4) +
              (*(float *)(local_20 + 0x2e8) - pfVar4[2]) *
              (*(float *)(local_20 + 0x2e8) - pfVar4[2]);
      if (local_24 <= fVar7) goto LAB_0075b5b0;
      uVar1 = *(uint *)(*(int *)(this + 0x2c) + iVar6 * 0x14);
      local_24 = fVar7;
      if (((uVar1 != 0xffffffff) &&
          (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
        local_2c = *(undefined4 *)(puVar5 + 4);
        goto LAB_0075b5b0;
      }
      iVar6 = iVar6 + 1;
      local_2c = 0;
    } while (iVar6 < *(int *)(this + 0x38));
  }
  return 0;
}

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)