L L4D2node

DirectChasePath::IsRepathNeeded

0x00951c70 · 349 bytes · __thiscall

_ZNK15DirectChasePath14IsRepathNeededEP8INextBotP11CBaseEntity

Decompiled

undefined (3 params)

/* DirectChasePath::IsRepathNeeded(INextBot*, CBaseEntity*) const */

bool __thiscall
DirectChasePath::IsRepathNeeded(DirectChasePath *this,INextBot *param_1,CBaseEntity *param_2)

{
  char cVar1;
  bool bVar2;
  float *pfVar3;
  int *piVar4;
  longdouble lVar5;
  float fVar6;
  
  pfVar3 = (float *)(**(code **)(*(int *)param_1 + 0xd4))(param_1);
  if (((byte)param_2[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(param_2);
  }
  fVar6 = SQRT((*(float *)(param_2 + 0x2e4) - pfVar3[1]) * (*(float *)(param_2 + 0x2e4) - pfVar3[1])
               + (*(float *)(param_2 + 0x2e0) - *pfVar3) * (*(float *)(param_2 + 0x2e0) - *pfVar3) +
               (*(float *)(param_2 + 0x2e8) - pfVar3[2]) * (*(float *)(param_2 + 0x2e8) - pfVar3[2])
              ) * 0.33;
  pfVar3 = (float *)(**(code **)(*(int *)this + 0x18))(this);
  if (((byte)param_2[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(param_2);
  }
  if (fVar6 * fVar6 <
      (*(float *)(param_2 + 0x2e0) - *pfVar3) * (*(float *)(param_2 + 0x2e0) - *pfVar3) +
      (*(float *)(param_2 + 0x2e8) - pfVar3[2]) * (*(float *)(param_2 + 0x2e8) - pfVar3[2]) +
      (*(float *)(param_2 + 0x2e4) - pfVar3[1]) * (*(float *)(param_2 + 0x2e4) - pfVar3[1])) {
    return true;
  }
  piVar4 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
  cVar1 = (**(code **)(*piVar4 + 0x168))(piVar4);
  if (cVar1 == '\0') {
    bVar2 = false;
  }
  else {
    piVar4 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
    lVar5 = (longdouble)(**(code **)(*piVar4 + 0x16c))(piVar4);
    bVar2 = 2.0 < (float)lVar5;
  }
  return bVar2;
}

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)