L L4D2node

CDirectorTacticalServices::GetRangeToClosestZombie

0x008c1c70 · 296 bytes · __thiscall

_ZNK25CDirectorTacticalServices23GetRangeToClosestZombieEbP11CBaseEntity

Decompiled

undefined (3 params)

/* CDirectorTacticalServices::GetRangeToClosestZombie(bool, CBaseEntity*) const */

longdouble __thiscall
CDirectorTacticalServices::GetRangeToClosestZombie
          (CDirectorTacticalServices *this,bool param_1,CBaseEntity *param_2)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  longdouble lVar5;
  float fVar6;
  float local_40;
  undefined4 local_34;
  int *local_30;
  undefined4 local_2c;
  undefined4 local_28;
  int local_24;
  int *local_20;
  
  local_30 = (int *)0x0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = (int *)0x0;
  local_34 = 1;
                    /* try { // try from 008c1ca6 to 008c1d46 has its CatchHandler @ 008c1da5 */
  iVar2 = TheNextBots();
  uVar3 = (uint)*(ushort *)(iVar2 + 0x10);
  if (uVar3 != 0xffff) {
    iVar4 = *(int *)(iVar2 + 4);
    do {
      cVar1 = CommonInfectedCollector::operator()
                        ((CommonInfectedCollector *)&local_34,*(INextBot **)(iVar4 + uVar3 * 8));
      if (cVar1 == '\0') break;
      iVar4 = *(int *)(iVar2 + 4);
      uVar3 = (uint)*(ushort *)(iVar4 + 6 + uVar3 * 8);
    } while (uVar3 != 0xffff);
  }
  if (local_24 < 1) {
    fVar6 = 0.0;
  }
  else {
    lVar5 = (longdouble)
            (**(code **)(*(int *)(*local_30 + 0x1a3c) + 0x124))(*local_30 + 0x1a3c,param_2);
    fVar6 = (float)lVar5;
    if (0 < local_24) {
      iVar2 = 0;
      local_40 = fVar6;
      do {
        lVar5 = (longdouble)
                (**(code **)(*(int *)(local_30[iVar2] + 0x1a3c) + 0x124))
                          (local_30[iVar2] + 0x1a3c,param_2);
        iVar2 = iVar2 + 1;
        fVar6 = (float)lVar5;
        if (local_40 <= (float)lVar5) {
          fVar6 = local_40;
        }
        local_40 = fVar6;
      } while (iVar2 < local_24);
    }
  }
  local_24 = 0;
  CUtlMemory<Infected*,int>::Purge((CUtlMemory<Infected*,int> *)&local_30);
  local_20 = local_30;
  CUtlMemory<Infected*,int>::Purge((CUtlMemory<Infected*,int> *)&local_30);
  return (longdouble)fVar6;
}

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)