L L4D2node

SurvivorBot::QueryReachableCacheNeighbor

0x0093c380 · 555 bytes · __thiscall

_ZNK11SurvivorBot27QueryReachableCacheNeighborEP8CNavAreaS1_

Decompiled

undefined (3 params)

/* SurvivorBot::QueryReachableCacheNeighbor(CNavArea*, CNavArea*) const */

byte __thiscall
SurvivorBot::QueryReachableCacheNeighbor(SurvivorBot *this,CNavArea *param_1,CNavArea *param_2)

{
  bool bVar1;
  CNavArea *pCVar2;
  char cVar3;
  bool bVar4;
  int iVar5;
  undefined4 *puVar6;
  float fVar7;
  CNavArea *in_stack_ffffffa8;
  CNavArea *local_38;
  undefined **local_2c;
  SurvivorBot *local_28;
  undefined4 local_24;
  undefined1 local_20;
  undefined1 local_1f;
  
  puVar6 = &m_isReachableCache;
  iVar5 = 0;
  do {
    if ((float)puVar6[3] < 0.0) {
      return 2;
    }
    fVar7 = *(float *)(gpGlobals + 0xc) - (float)puVar6[3];
    if (*(float *)(SurvivorBotReachabilityCacheLifetime._28_4_ + 0x2c) <= fVar7 &&
        fVar7 != *(float *)(SurvivorBotReachabilityCacheLifetime._28_4_ + 0x2c)) {
      return 2;
    }
    if ((*(int *)((CNavArea *)*puVar6 + 0x8c) == *(int *)(param_1 + 0x8c)) ||
       (in_stack_ffffffa8 = param_1,
       cVar3 = IsReachableNeighbor(this,param_1,(CNavArea *)*puVar6,*(bool *)(puVar6 + 2)),
       cVar3 != '\0')) {
      local_38 = (CNavArea *)puVar6[1];
      if (*(int *)(local_38 + 0x8c) == *(int *)(param_2 + 0x8c)) {
LAB_0093c45e:
        bVar1 = *(bool *)(puVar6 + 2);
        pCVar2 = (CNavArea *)*puVar6;
        CacheReachability(param_1,param_2,iVar5,bVar1,(float)in_stack_ffffffa8);
        if (*(int *)(sb_reachable_cache_paranoia._28_4_ + 0x30) != 0) {
          local_2c = &PTR_operator___00d09770;
          local_28 = this + 0x4028;
          local_24 = (**(code **)(*(int *)(this + 0x4028) + 0xc0))(local_28);
          local_20 = 0;
          local_1f = 1;
          bVar4 = NavAreaBuildPath<SurvivorBotPathCost>
                            (param_1,param_2,(Vector *)0x0,(Vector *)0x0,
                             (SurvivorBotPathCost *)&local_2c,(CNavArea **)0x0,0.0,-1,false);
          if ((bVar1 != bVar4) &&
             (bVar4 = NavAreaBuildPath<SurvivorBotPathCost>
                                (pCVar2,local_38,(Vector *)0x0,(Vector *)0x0,
                                 (SurvivorBotPathCost *)&local_2c,(CNavArea **)0x0,0.0,-1,false),
             bVar1 == bVar4)) {
            Warning("Call brian! Reachability neighbor cache screwed! from: %d (cached neighbor %d) to: %d (cached neighbor %d)\n"
                    ,*(undefined4 *)(param_1 + 0x8c),*(undefined4 *)(pCVar2 + 0x8c),
                    *(undefined4 *)(param_2 + 0x8c),*(undefined4 *)(local_38 + 0x8c));
          }
        }
        return bVar1 ^ 1;
      }
      in_stack_ffffffa8 = param_2;
      cVar3 = IsReachableNeighbor(this,param_2,local_38,(bool)(*(byte *)(puVar6 + 2) ^ 1));
      if (cVar3 != '\0') {
        local_38 = (CNavArea *)puVar6[1];
        goto LAB_0093c45e;
      }
    }
    iVar5 = iVar5 + 1;
    puVar6 = puVar6 + 4;
    if (iVar5 == 0x60) {
      return 2;
    }
  } 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)