L L4D2node

CBasePlayer::IsValidObserverTarget

0x007a8d20 · 210 bytes · __thiscall

_ZN11CBasePlayer21IsValidObserverTargetEP11CBaseEntity

Decompiled

undefined (2 params)

/* CBasePlayer::IsValidObserverTarget(CBaseEntity*) */

undefined4 __thiscall CBasePlayer::IsValidObserverTarget(CBasePlayer *this,CBaseEntity *param_1)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  CBasePlayer *pCVar5;
  
  if ((param_1 != (CBaseEntity *)0x0) &&
     (cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar1 != '\0')) {
    cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
    pCVar5 = (CBasePlayer *)0x0;
    if (cVar1 != '\0') {
      pCVar5 = (CBasePlayer *)param_1;
    }
    if ((((this != pCVar5) && (((byte)pCVar5[0xd4] & 0x20) == 0)) &&
        (pCVar5[0x104] != (CBasePlayer)0x3)) &&
       ((1 < (byte)((char)pCVar5[0x104] - 1U) ||
        (*(float *)(gpGlobals + 0xc) <= *(float *)(pCVar5 + 0x1d5c) + 6.0)))) {
      iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
      if (iVar2 == 1) {
LAB_007a8dc0:
                    /* WARNING: Could not recover jumptable at 0x007a8dd5. Too many branches */
                    /* WARNING: Treating indirect jump as call */
        uVar4 = (**(code **)(*(int *)this + 0x660))();
        return uVar4;
      }
      if (*(int *)(mp_forcecamera._28_4_ + 0x30) == 1) {
        iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
        iVar3 = CBaseEntity::GetTeamNumber(param_1);
        if (iVar2 == iVar3) goto LAB_007a8dc0;
      }
      else if (*(int *)(mp_forcecamera._28_4_ + 0x30) != 2) goto LAB_007a8dc0;
    }
  }
  return 0;
}

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)