L L4D2node

SurvivorTeamSituation::GetClosestReachableFriend

0x00968040 · 269 bytes · __thiscall

_ZNK21SurvivorTeamSituation25GetClosestReachableFriendEv

Decompiled

undefined (1 param)

/* SurvivorTeamSituation::GetClosestReachableFriend() const */

undefined4 __thiscall SurvivorTeamSituation::GetClosestReachableFriend(SurvivorTeamSituation *this)

{
  uint uVar1;
  int *piVar2;
  CTerrorPlayer *pCVar3;
  undefined *puVar4;
  int iVar5;
  longdouble lVar6;
  undefined4 local_28;
  float local_24;
  
  if (*(int *)(this + 0xc4) < 1) {
    local_28 = 0;
  }
  else {
    iVar5 = 0;
    local_28 = 0;
    local_24 = 3.4028235e+38;
    do {
      uVar1 = *(uint *)(this + iVar5 * 4 + 0x88);
      pCVar3 = (CTerrorPlayer *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
        pCVar3 = *(CTerrorPlayer **)(puVar4 + 4);
      }
      piVar2 = (int *)GetPathToFriend(this,pCVar3);
      if (piVar2 != (int *)0x0) {
        lVar6 = (longdouble)(**(code **)(*piVar2 + 8))(piVar2);
        if ((float)lVar6 < local_24) {
          uVar1 = *(uint *)(this + iVar5 * 4 + 0x88);
          local_28 = 0;
          if (((uVar1 != 0xffffffff) &&
              (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc))
             && (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
            local_28 = *(undefined4 *)(puVar4 + 4);
          }
          lVar6 = (longdouble)(**(code **)(*piVar2 + 8))(piVar2);
          local_24 = (float)lVar6;
        }
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 < *(int *)(this + 0xc4));
  }
  return local_28;
}

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)