L L4D2node

CBasePlayer::CheckObserverSettings

0x007a9f80 · 796 bytes · __thiscall

_ZN11CBasePlayer21CheckObserverSettingsEv

Decompiled

undefined (1 param)

/* CBasePlayer::CheckObserverSettings() */

void __thiscall CBasePlayer::CheckObserverSettings(CBasePlayer *this)

{
  uint uVar1;
  uint uVar2;
  code *pcVar3;
  char cVar4;
  undefined4 *puVar5;
  float *pfVar6;
  float *pfVar7;
  undefined4 uVar8;
  int *piVar9;
  undefined *puVar10;
  int iVar11;
  int local_24;
  int *local_20;
  
  if (this[0x1d80] == (CBasePlayer)0x0) {
    if (*(int *)(this + 0x1d78) < 3) {
      *(undefined4 *)(this + 0x1d78) = 6;
    }
    if (*(int *)(this + 0x1d64) - 4U < 2) {
      (**(code **)(*(int *)this + 0x678))(this);
      uVar1 = *(uint *)(this + 0x1d7c);
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar10 + 8) == uVar1 >> 0xc &&
          ((piVar9 = *(int **)(puVar10 + 4), piVar9 != (int *)0x0 &&
           (cVar4 = (**(code **)(*piVar9 + 0x16c))(piVar9), cVar4 != '\0')))))) {
        if (*(int *)(this + 0x1d64) == 4) {
          uVar1 = *(uint *)(this + 0x150);
          uVar2 = piVar9[0x54];
          if ((uVar2 & 3) != (uVar1 & 3)) {
            CBaseEntity::ClearFlags((CBaseEntity *)this);
            CBaseEntity::AddFlag((CBaseEntity *)this,uVar1 & 0xfffffffc | uVar2 & 3);
          }
          pfVar6 = (float *)(**(code **)(*(int *)this + 0x250))(this);
          pfVar7 = (float *)(**(code **)(*piVar9 + 0x250))(piVar9);
          if (((*pfVar6 != *pfVar7) || (pfVar6[1] != pfVar7[1])) || (pfVar6[2] != pfVar7[2])) {
            pcVar3 = *(code **)(*(int *)this + 0x254);
            uVar8 = (**(code **)(*piVar9 + 0x250))(piVar9);
            (*pcVar3)(this,uVar8);
          }
        }
        uVar1 = piVar9[0x705];
        local_20 = (int *)0x0;
        if (((uVar1 != 0xffffffff) &&
            (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
          local_20 = *(int **)(puVar10 + 4);
        }
        uVar2 = *(uint *)(this + 0x1c14);
        local_24 = 0;
        if (((uVar2 != 0xffffffff) &&
            (puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar10 + 8) == uVar2 >> 0xc)) {
          local_24 = *(int *)(puVar10 + 4);
        }
        if (local_20 != (int *)local_24) {
          local_20 = (int *)0x0;
          if (((uVar1 != 0xffffffff) &&
              (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)
              ) && (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
            local_20 = *(int **)(puVar10 + 4);
          }
          piVar9 = (int *)0x0;
          if (((uVar2 != 0xffffffff) &&
              (puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)
              ) && (*(uint *)(puVar10 + 8) == uVar2 >> 0xc)) {
            piVar9 = *(int **)(puVar10 + 4);
          }
          if (local_20 != piVar9) {
            (**(code **)(*(int *)(this + 0x1c10) + 4))(this + 0x1c10,this + 0x1c14);
            if (local_20 == (int *)0x0) {
              *(undefined4 *)(this + 0x1c14) = 0xffffffff;
            }
            else {
              puVar5 = (undefined4 *)(**(code **)(*local_20 + 0xc))(local_20);
              *(undefined4 *)(this + 0x1c14) = *puVar5;
            }
          }
        }
      }
    }
  }
  else {
    uVar1 = *(uint *)(this + 0x1d7c);
    iVar11 = 0;
    if (((uVar1 != 0xffffffff) &&
        (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
      iVar11 = *(int *)(puVar10 + 4);
    }
    cVar4 = (**(code **)(*(int *)this + 0x664))(this,iVar11);
    if (cVar4 == '\0') {
      iVar11 = (**(code **)(*(int *)this + 0x658))(this,0);
    }
    if (iVar11 != 0) {
      this[0x1d80] = (CBasePlayer)0x0;
      (**(code **)(*(int *)this + 0x644))(this,*(undefined4 *)(this + 0x1d78));
      (**(code **)(*(int *)this + 0x64c))(this,iVar11);
    }
  }
  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)