L L4D2node

AddWatcherToEntity

0x00478470 · 88 bytes · __regparm3

_ZL18AddWatcherToEntityP11CBaseEntityS0_i

Decompiled

undefined (3 params)

/* AddWatcherToEntity(CBaseEntity*, CBaseEntity*, int) */

void __regparm3 AddWatcherToEntity(CBaseEntity *param_1,CBaseEntity *param_2,int param_3)

{
  undefined2 uVar1;
  CWatcherList *this;
  
  this = (CWatcherList *)CBaseEntity::GetDataObject(param_2,param_3);
  if (this == (CWatcherList *)0x0) {
    this = (CWatcherList *)CBaseEntity::CreateDataObject(param_2,param_3);
    uVar1 = CUtlMultiList<watcher_t,unsigned_short>::CreateList
                      ((CUtlMultiList<watcher_t,unsigned_short> *)&g_WatcherList);
    *(undefined2 *)this = uVar1;
  }
  CWatcherList::AddToList(this,param_1);
  return;
}

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)