L L4D2node

CTerrorPlayer::WantsRoamingObserverMode

0x009b7370 · 188 bytes · __thiscall

_ZNK13CTerrorPlayer24WantsRoamingObserverModeEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::WantsRoamingObserverMode() const */

undefined4 __thiscall CTerrorPlayer::WantsRoamingObserverMode(CTerrorPlayer *this)

{
  int iVar1;
  char *__nptr;
  long lVar2;
  int local_18;
  int local_14;
  CTerrorPlayer *local_10;
  
  if (*(int *)(this + 0x30) == 0) {
    iVar1 = 0;
  }
  else {
    iVar1 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
  }
  __nptr = (char *)(**(code **)(*engine + 0xe0))(engine,iVar1,"spec_allowroaming");
  if ((__nptr != (char *)0x0) && (lVar2 = strtol(__nptr,(char **)0x0,10), lVar2 == 0)) {
    return 0;
  }
  iVar1 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  if (iVar1 == 1) {
    local_18 = 0;
    local_14 = 0;
    local_10 = this;
    ForEachTerrorPlayer<FindBotSpectator>((FindBotSpectator *)&local_18);
    if ((local_18 != 0) || (local_14 != 0)) {
      return 0;
    }
  }
  return 1;
}

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)