L L4D2node

L4D1SurvivorBehavior::OnSight

0x00922f50 · 157 bytes · __thiscall

_ZN20L4D1SurvivorBehavior7OnSightEP11SurvivorBotP11CBaseEntity

Decompiled

undefined (3 params)

/* L4D1SurvivorBehavior::OnSight(SurvivorBot*, CBaseEntity*) */

L4D1SurvivorBehavior * __thiscall
L4D1SurvivorBehavior::OnSight(L4D1SurvivorBehavior *this,SurvivorBot *param_1,CBaseEntity *param_2)

{
  IVision *this_00;
  longdouble lVar1;
  int local_10;
  
  local_10 = 0;
  this_00 = (IVision *)(**(code **)(*(int *)param_2 + 0x9ac))(param_2);
  IVision::ForEachRecognized<ThreatCounter>(this_00,(ThreatCounter *)&local_10);
  if (7 < local_10) {
    lVar1 = (longdouble)RandomFloat(0x3f000000,0x3f800000);
    SurvivorBot::Say((SurvivorBot *)param_2,"SurvivorBotWarnIncoming",2,(float)lVar1,0);
  }
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  *(undefined4 *)(this + 0xc) = 1;
  return this;
}

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)