L L4D2node

ChasePath::IsRepathNeeded

0x003e3a60 · 261 bytes · __thiscall

_ZNK9ChasePath14IsRepathNeededEP8INextBotP11CBaseEntity

Decompiled

undefined (3 params)

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

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

{
  float *pfVar1;
  float fVar2;
  
  pfVar1 = (float *)(**(code **)(*(int *)param_1 + 0xd4))(param_1);
  if (((byte)param_2[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(param_2);
  }
  fVar2 = SQRT((*(float *)(param_2 + 0x2e4) - pfVar1[1]) * (*(float *)(param_2 + 0x2e4) - pfVar1[1])
               + (*(float *)(param_2 + 0x2e0) - *pfVar1) * (*(float *)(param_2 + 0x2e0) - *pfVar1) +
               (*(float *)(param_2 + 0x2e8) - pfVar1[2]) * (*(float *)(param_2 + 0x2e8) - pfVar1[2])
              ) * 0.33;
  pfVar1 = (float *)(**(code **)(*(int *)this + 0x18))(this);
  if (((byte)param_2[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(param_2);
  }
  return fVar2 * fVar2 <
         (*(float *)(param_2 + 0x2e4) - pfVar1[1]) * (*(float *)(param_2 + 0x2e4) - pfVar1[1]) +
         (*(float *)(param_2 + 0x2e0) - *pfVar1) * (*(float *)(param_2 + 0x2e0) - *pfVar1) +
         (*(float *)(param_2 + 0x2e8) - pfVar1[2]) * (*(float *)(param_2 + 0x2e8) - pfVar1[2]);
}

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)