L L4D2node

CBasePlayer::ResetObserverMode

0x00418b60 · 220 bytes · __thiscall

_ZN11CBasePlayer17ResetObserverModeEv

Decompiled

undefined (1 param)

/* CBasePlayer::ResetObserverMode() */

void __thiscall CBasePlayer::ResetObserverMode(CBasePlayer *this)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  undefined *puVar4;
  
  uVar1 = *(uint *)(this + 0x1d7c);
  if ((((uVar1 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
    if (this[0x6c] == (CBasePlayer)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1d7c) = 0xffffffff;
  }
  if (*(int *)(this + 0x1d64) != 0) {
    if (this[0x6c] == (CBasePlayer)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
      *(undefined4 *)(this + 0x1d64) = 0;
    }
    else {
      this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
      *(undefined4 *)(this + 0x1d64) = 0;
    }
  }
  *(uint *)(this + 0x1d20) = *(uint *)(this + 0x1d20) & 0xfffffff7;
  this[0x1d80] = (CBasePlayer)0x0;
  *(undefined4 *)(this + 0x1d78) = 6;
  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)