L L4D2node

CTerrorPlayer::GetIdealViewDistance

0x004f3a40 · 1469 bytes · __thiscall

_ZNK13CTerrorPlayer20GetIdealViewDistanceEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::GetIdealViewDistance() const */

longdouble __thiscall CTerrorPlayer::GetIdealViewDistance(CTerrorPlayer *this)

{
  uint uVar1;
  uint uVar2;
  int *piVar3;
  char cVar4;
  int iVar5;
  CTongue *this_00;
  undefined4 uVar6;
  undefined *puVar7;
  longdouble lVar8;
  float fVar9;
  
  iVar5 = CMultiPlayerAnimState::GetMainActivity(*(CMultiPlayerAnimState **)(this + 0x2910));
  if (this[0x39f1] != (CTerrorPlayer)0x0) goto LAB_004f3ce0;
  if ((this[0x33dc] != (CTerrorPlayer)0x0) ||
     ((((uVar1 = *(uint *)(this + 0x33c4), uVar1 != 0xffffffff &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) &&
      ((*(int *)(puVar7 + 4) != 0 &&
       (lVar8 = (longdouble)IntervalTimer::Now(), 1.0 < (float)lVar8 - *(float *)(this + 0x33cc)))))
     )) {
    fVar9 = -100.0;
    goto LAB_004f3a78;
  }
  uVar1 = *(uint *)(this + 0x3e64);
  if ((((uVar1 != 0xffffffff) &&
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
      ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc && (*(int *)(puVar7 + 4) != 0)))) ||
     (((((uVar1 = *(uint *)(this + 0x3e68), uVar1 != 0xffffffff &&
         (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)) ||
      ((((((uVar1 = *(uint *)(this + 0x3e48), uVar1 != 0xffffffff &&
           (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
          ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc && (*(int *)(puVar7 + 4) != 0)))) ||
         (((((uVar2 = *(uint *)(this + 0x3ee0), uVar2 != 0xffffffff &&
             (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc))
            && (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)) ||
          ((((uVar2 = *(uint *)(this + 0x3edc), uVar2 != 0xffffffff &&
             (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc))
            && (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)))))) ||
        (((uVar1 != 0xffffffff &&
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc && (*(int *)(puVar7 + 4) != 0)))))) ||
       (((uVar1 = *(uint *)(this + 0x3e44), uVar1 != 0xffffffff &&
         (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
        ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc && (*(int *)(puVar7 + 4) != 0)))))))))) {
LAB_004f3d5b:
    fVar9 = -86.0;
    goto LAB_004f3a78;
  }
  uVar1 = *(uint *)(this + 0x2a4c);
  if (((((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)) ||
     (iVar5 - 0x211U < 2)) {
LAB_004f3dab:
    fVar9 = -240.0;
    goto LAB_004f3a78;
  }
  fVar9 = -86.0;
  if (iVar5 == 0x303) goto LAB_004f3a78;
  cVar4 = (**(code **)(*(int *)this + 0x7e8))(this);
  if (((cVar4 == '\0') || (iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar5 != 3)) ||
     (iVar5 = (**(code **)(*(int *)this + 0x544))(this), iVar5 != 8)) {
    iVar5 = GetStaggerDir(this);
    if ((iVar5 != 0) && (iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar5 == 3)) {
LAB_004f3ce0:
      return (longdouble)-64.0;
    }
    cVar4 = IsPerformingActionOnSomeoneElse(this,0);
    if (cVar4 == '\0') {
      cVar4 = IsPerformingActionOnSelf(this,0);
      if (cVar4 != '\0') goto LAB_004f3ce0;
      uVar1 = *(uint *)(this + 0x2e28);
      if ((((uVar1 != 0xffffffff) &&
           (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) && (fVar9 = -64.0, *(int *)(puVar7 + 4) != 0))
      goto LAB_004f3a78;
      cVar4 = CBaseCombatCharacter::IsA((CBaseCombatCharacter *)this,1);
      if (cVar4 == '\0') {
        cVar4 = CBaseCombatCharacter::IsA((CBaseCombatCharacter *)this,2);
        if (cVar4 == '\0') {
          cVar4 = CBaseCombatCharacter::IsA((CBaseCombatCharacter *)this,3);
          fVar9 = 0.0;
          if (cVar4 != '\0') goto LAB_004f3a78;
          cVar4 = CBaseCombatCharacter::IsA((CBaseCombatCharacter *)this,6);
          if (cVar4 == '\0') {
            uVar6 = CMultiPlayerAnimState::GetMainActivity
                              (*(CMultiPlayerAnimState **)(this + 0x2910));
            cVar4 = IsMotionControlledXY(this,uVar6);
            if (((cVar4 != '\0') ||
                (iVar5 = CMultiPlayerAnimState::GetMainActivity
                                   (*(CMultiPlayerAnimState **)(this + 0x2910)), iVar5 == 0x20e)) ||
               (iVar5 == 0x2fa)) {
              cVar4 = CBaseCombatCharacter::IsA((CBaseCombatCharacter *)this,8);
              fVar9 = -64.0;
              if (cVar4 != '\0') {
                fVar9 = -96.0;
              }
              goto LAB_004f3a78;
            }
            if (*(float *)(this + 0x401c) < *(float *)(gpGlobals + 0xc) ||
                *(float *)(this + 0x401c) == *(float *)(gpGlobals + 0xc)) goto LAB_004f3ea6;
          }
          else {
            uVar1 = *(uint *)(this + 0x30bc);
            if (((uVar1 != 0xffffffff) &&
                (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)
                ) && ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc &&
                      ((piVar3 = *(int **)(puVar7 + 4), piVar3 != (int *)0x0 &&
                       (cVar4 = (**(code **)(*piVar3 + 0x354))(piVar3), cVar4 != '\0'))))))
            goto LAB_004f3dab;
            cVar4 = IsPummeling(this);
            if (cVar4 == '\0') goto LAB_004f3ea6;
          }
          goto LAB_004f3c8d;
        }
        if (((((*(int *)(this + 0x4018) == 1) &&
              (uVar1 = *(uint *)(this + 0x30bc), uVar1 != 0xffffffff)) &&
             (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc))
            && ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc &&
                (piVar3 = *(int **)(puVar7 + 4), piVar3 != (int *)0x0)))) &&
           (cVar4 = (**(code **)(*piVar3 + 0x354))(piVar3), cVar4 != '\0')) goto LAB_004f3c8d;
      }
      else {
        uVar1 = *(uint *)(this + 0x30bc);
        if (((uVar1 != 0xffffffff) &&
            (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
           ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc &&
            (((*(int *)(puVar7 + 4) != 0 &&
              (this_00 = (CTongue *)
                         __dynamic_cast(*(int *)(puVar7 + 4),&CBaseAbility::typeinfo,
                                        &CTongue::typeinfo,0), this_00 != (CTongue *)0x0)) &&
             (cVar4 = CTongue::IsTongueThirdPerson(this_00), cVar4 != '\0')))))) goto LAB_004f3ce0;
      }
LAB_004f3ea6:
      fVar9 = 0.0;
      goto LAB_004f3a78;
    }
    if (*(int *)(this + 0x2b44) == 10) goto LAB_004f3d5b;
  }
LAB_004f3c8d:
  fVar9 = -128.0;
LAB_004f3a78:
  return (longdouble)fVar9;
}

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)