L L4D2node

CBasePlayer::SetFOV

0x00419f20 · 702 bytes · __thiscall

_ZN11CBasePlayer6SetFOVEP11CBaseEntityifi

Decompiled

undefined (5 params)

/* CBasePlayer::SetFOV(CBaseEntity*, int, float, int) */

undefined4 __thiscall
CBasePlayer::SetFOV(CBasePlayer *this,CBaseEntity *param_1,int param_2,float param_3,int param_4)

{
  float fVar1;
  uint uVar2;
  CBaseEntity *pCVar3;
  CBaseEdict *pCVar4;
  char cVar5;
  int iVar6;
  undefined4 *puVar7;
  undefined4 uVar8;
  int iVar9;
  undefined *puVar10;
  
  if (param_1 == (CBaseEntity *)0x0) {
LAB_00419fd0:
    uVar8 = 0;
  }
  else {
    uVar2 = *(uint *)(this + 0x1d84);
    if ((uVar2 == 0xffffffff) ||
       (puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) {
      if (param_2 != 0) {
LAB_00419f8f:
        if (this[0x6c] == (CBasePlayer)0x0) {
          pCVar4 = *(CBaseEdict **)(this + 0x30);
          if (pCVar4 != (CBaseEdict *)0x0) {
            *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
            iVar6 = CBaseEdict::GetChangeAccessor(pCVar4);
            *(undefined2 *)(iVar6 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
        }
        puVar7 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
        *(undefined4 *)(this + 0x1d84) = *puVar7;
      }
    }
    else if (((*(uint *)(puVar10 + 8) == uVar2 >> 0xc) &&
             (pCVar3 = *(CBaseEntity **)(puVar10 + 4), pCVar3 != (CBaseEntity *)0x0)) &&
            (param_1 != pCVar3)) {
      cVar5 = CanOverrideEnvZoomOwner(pCVar3);
      if (cVar5 == '\0') goto LAB_00419fd0;
    }
    else if (param_2 == 0) {
      if (((puVar10 != (undefined *)0xfffffffc) && (*(uint *)(puVar10 + 8) == uVar2 >> 0xc)) &&
         (*(int *)(puVar10 + 4) != 0)) {
        if (this[0x6c] == (CBasePlayer)0x0) {
          pCVar4 = *(CBaseEdict **)(this + 0x30);
          if (pCVar4 != (CBaseEdict *)0x0) {
            *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
            iVar6 = CBaseEdict::GetChangeAccessor(pCVar4);
            *(undefined2 *)(iVar6 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0x1d84) = 0xffffffff;
      }
    }
    else if ((*(uint *)(puVar10 + 8) != uVar2 >> 0xc) || (param_1 != *(CBaseEntity **)(puVar10 + 4))
            ) goto LAB_00419f8f;
    if (param_4 < 1) {
      iVar6 = GetFOV(this);
      if (iVar6 != *(int *)(this + 0x1d70)) {
        if (this[0x6c] == (CBasePlayer)0x0) {
          pCVar4 = *(CBaseEdict **)(this + 0x30);
          if (pCVar4 != (CBaseEdict *)0x0) {
            *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
            iVar9 = CBaseEdict::GetChangeAccessor(pCVar4);
            *(undefined2 *)(iVar9 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
        }
        *(int *)(this + 0x1d70) = iVar6;
      }
    }
    else if (param_4 != *(int *)(this + 0x1d70)) {
      if (this[0x6c] == (CBasePlayer)0x0) {
        pCVar4 = *(CBaseEdict **)(this + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
      }
      *(int *)(this + 0x1d70) = param_4;
    }
    fVar1 = *(float *)(gpGlobals + 0xc);
    if (fVar1 != *(float *)(this + 0x1d74)) {
      if (this[0x6c] == (CBasePlayer)0x0) {
        pCVar4 = *(CBaseEdict **)(this + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x1d74) = fVar1;
    }
    if (param_2 != *(int *)(this + 0x1d68)) {
      if (this[0x6c] == (CBasePlayer)0x0) {
        pCVar4 = *(CBaseEdict **)(this + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
      }
      *(int *)(this + 0x1d68) = param_2;
    }
    uVar8 = 1;
    if (param_3 != *(float *)(this + 0x1a80)) {
      (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a80);
      *(float *)(this + 0x1a80) = param_3;
      return 1;
    }
  }
  return uVar8;
}

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)