L L4D2node

CBasePlayer::ValidateCurrentObserverTarget

0x007abf10 · 314 bytes · __thiscall

_ZN11CBasePlayer29ValidateCurrentObserverTargetEv

Decompiled

undefined (1 param)

/* CBasePlayer::ValidateCurrentObserverTarget() */

void __thiscall CBasePlayer::ValidateCurrentObserverTarget(CBasePlayer *this)

{
  uint uVar1;
  CBaseEdict *this_00;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  undefined *puVar5;
  
  uVar4 = 0;
  uVar1 = *(uint *)(this + 0x1d7c);
  if (((uVar1 != 0xffffffff) &&
      (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
    uVar4 = *(undefined4 *)(puVar5 + 4);
  }
  cVar2 = (**(code **)(*(int *)this + 0x664))(this,uVar4);
  if (cVar2 == '\0') {
    iVar3 = (**(code **)(*(int *)this + 0x658))(this,0);
    if (iVar3 != 0) {
      (**(code **)(*(int *)this + 0x64c))(this,iVar3);
      return;
    }
    if (*(int *)(mp_forcecamera._28_4_ + 0x30) == 0) {
      (**(code **)(*(int *)this + 0x670))(this,6);
    }
    else {
      (**(code **)(*(int *)this + 0x670))(this,3);
      uVar1 = *(uint *)(this + 0x1d7c);
      if (((uVar1 != 0xffffffff) &&
          (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) {
        if (this[0x6c] == (CBasePlayer)0x0) {
          this_00 = *(CBaseEdict **)(this + 0x30);
          if (this_00 != (CBaseEdict *)0x0) {
            *(uint *)this_00 = *(uint *)this_00 | 0x101;
            iVar3 = CBaseEdict::GetChangeAccessor(this_00);
            *(undefined2 *)(iVar3 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0x1d7c) = 0xffffffff;
      }
    }
  }
  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)