L L4D2node

CTerrorPlayer::SetObserverMode

0x009de310 · 231 bytes · __thiscall

_ZN13CTerrorPlayer15SetObserverModeEi

Decompiled

undefined (2 params)

/* CTerrorPlayer::SetObserverMode(int) */

undefined4 __thiscall CTerrorPlayer::SetObserverMode(CTerrorPlayer *this,int param_1)

{
  int iVar1;
  undefined4 uVar2;
  CTerrorPlayer *pCVar3;
  CSurvivorRescue *this_00;
  int local_20 [4];
  
  iVar1 = (**(code **)(*(int *)this + 0x648))(this);
  if (iVar1 == 3) {
    this_00 = (CSurvivorRescue *)0x0;
    while( true ) {
      if (((infoSurvivorRescueStr == 0) ||
          (iVar1 = infoSurvivorRescueStr, DAT_0102093c != CGameString::gm_iSerialNumber)) &&
         (iVar1 = 0, DAT_01020938 != 0)) {
        AllocPooledString((char *)local_20);
        infoSurvivorRescueStr = local_20[0];
        DAT_0102093c = CGameString::gm_iSerialNumber;
        iVar1 = local_20[0];
      }
      iVar1 = CGlobalEntityList::FindEntityByClassnameFast
                        ((CGlobalEntityList *)gEntList,this_00,iVar1);
      if ((iVar1 == 0) ||
         (this_00 = (CSurvivorRescue *)
                    __dynamic_cast(iVar1,&CBaseEntity::typeinfo,&CSurvivorRescue::typeinfo,0),
         this_00 == (CSurvivorRescue *)0x0)) break;
      pCVar3 = (CTerrorPlayer *)CSurvivorRescue::GetSurvivor(this_00);
      if (this == pCVar3) {
        return 0;
      }
    }
  }
  uVar2 = CBasePlayer::SetObserverMode((CBasePlayer *)this,param_1);
  return uVar2;
}

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)