L L4D2node

CTriggerCamera::Enable

0x00b1aa10 · 2020 bytes · __thiscall

_ZN14CTriggerCamera6EnableEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CTriggerCamera::Enable() */

void __thiscall CTriggerCamera::Enable(CTriggerCamera *this)

{
  undefined4 uVar1;
  uint uVar2;
  code *pcVar3;
  char cVar4;
  uint uVar5;
  uint *puVar6;
  int *piVar7;
  int iVar8;
  CBaseEntity *pCVar9;
  char *pcVar10;
  CBaseAnimating *this_00;
  undefined *puVar11;
  int *piVar12;
  CBaseEntity *pCVar13;
  CBaseEntity *this_01;
  longdouble lVar14;
  int *local_38;
  undefined1 local_34 [12];
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  puVar11 = g_pEntityList;
  piVar12 = (int *)&stack0xffffffa4;
  *(undefined4 *)(this + 0x470) = 1;
  uVar5 = *(uint *)(this + 0x440);
  if (((uVar5 == 0xffffffff) ||
      (puVar11 = puVar11 + (uVar5 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar11 + 8) != uVar5 >> 0xc)) {
    uVar5 = *(uint *)(this + 0x148);
    pCVar13 = (CBaseEntity *)0x0;
    this_01 = (CBaseEntity *)0x0;
  }
  else {
    pCVar13 = *(CBaseEntity **)(puVar11 + 4);
    if (pCVar13 == (CBaseEntity *)0x0) {
      this_01 = (CBaseEntity *)0x0;
      uVar5 = *(uint *)(this + 0x148);
    }
    else {
      cVar4 = (**(code **)(*(int *)pCVar13 + 0x16c))();
      this_01 = (CBaseEntity *)0x0;
      if (cVar4 != '\0') {
        this_01 = pCVar13;
      }
      cVar4 = (**(code **)(*(int *)pCVar13 + 0x16c))();
      if (cVar4 != '\0') {
        *(int *)(this + 0x494) = *(int *)(this_01 + 0x1cb0);
      }
      *(int *)(this + 0x498) = (int)(char)pCVar13[0x105];
      if (pCVar13[0x105] != (CBaseEntity)0x0) {
        (**(code **)(*(int *)pCVar13 + 0x224))();
        pCVar13[0x105] = (CBaseEntity)0x0;
      }
      uVar5 = *(uint *)(this + 0x148);
      if ((uVar5 & 0x20) != 0) {
        CCollisionProperty::SetSolidFlags
                  ((CCollisionProperty *)(pCVar13 + 0x194),(uint)(*(ushort *)(pCVar13 + 0x1b4) | 4))
        ;
        uVar5 = *(uint *)(this + 0x148);
      }
    }
  }
  *(float *)(this + 0x454) = *(float *)(this + 0x450) + *(float *)(gpGlobals + 0xc);
  *(undefined4 *)(this + 0x11c) = *(undefined4 *)(this + 0x464);
  *(undefined4 *)(this + 0x460) = *(undefined4 *)(this + 0x464);
  if ((uVar5 & 0x10) != 0) {
    this[0x490] = (CTriggerCamera)0x1;
  }
  if (((uVar5 & 0x80) != 0) && (this_01 != (CBaseEntity *)0x0)) {
    uVar5 = *(uint *)(this_01 + 0x1d84);
    if (((uVar5 != 0xffffffff) &&
        ((puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc &&
         (*(uint *)(puVar11 + 8) == uVar5 >> 0xc)))) &&
       (pCVar9 = *(CBaseEntity **)(puVar11 + 4), pCVar9 != (CBaseEntity *)0x0)) {
      if ((*(char **)(pCVar9 + 0x7c) != "point_viewcontrol_multiplayer") &&
         (cVar4 = CBaseEntity::ClassMatchesComplex(pCVar9,"point_viewcontrol_multiplayer"),
         cVar4 == '\0')) {
        uVar5 = *(uint *)(this_01 + 0x1d84);
        pCVar9 = (CBaseEntity *)0x0;
        if (uVar5 != 0xffffffff) {
          puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10;
          if ((puVar11 == (undefined *)0xfffffffc) || (*(uint *)(puVar11 + 8) != uVar5 >> 0xc)) {
            pCVar9 = (CBaseEntity *)0x0;
          }
          else {
            pCVar9 = *(CBaseEntity **)(puVar11 + 4);
          }
        }
        if ((*(char **)(pCVar9 + 0x7c) != "point_viewcontrol") &&
           (cVar4 = CBaseEntity::ClassMatchesComplex(pCVar9,"point_viewcontrol"), cVar4 == '\0'))
        goto LAB_00b1aad8;
      }
      CBasePlayer::ClearZoomOwner((CBasePlayer *)this_01);
    }
LAB_00b1aad8:
    CBasePlayer::SetFOV((CBasePlayer *)this_01,(CBaseEntity *)this,(int)*(float *)(this + 0x480),
                        *(float *)(this + 0x484),0);
    uVar5 = *(uint *)(this + 0x148);
  }
  if ((uVar5 & 2) == 0) {
    piVar7 = (int *)CBaseEntity::GetNextTarget((CBaseEntity *)this);
    if (piVar7 == (int *)0x0) goto LAB_00b1ada8;
    puVar6 = (uint *)(**(code **)(*piVar7 + 0xc))();
    uVar5 = *puVar6;
    *(uint *)(this + 0x444) = uVar5;
  }
  else {
    if (pCVar13 == (CBaseEntity *)0x0) {
LAB_00b1ada8:
      *(undefined4 *)(this + 0x444) = 0xffffffff;
      goto LAB_00b1ab5e;
    }
    puVar6 = (uint *)(**(code **)(*(int *)pCVar13 + 0xc))();
    uVar5 = *puVar6;
    *(uint *)(this + 0x444) = uVar5;
  }
  if ((((uVar5 != 0xffffffff) &&
       (puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
      (uVar2 = *(uint *)(puVar11 + 8), uVar2 == uVar5 >> 0xc)) &&
     ((*(int *)(puVar11 + 4) != 0 &&
      (*(undefined4 *)(this + 0x48c) = 0, *(int *)(this + 0x488) != 0)))) {
    if (uVar2 == *(uint *)(puVar11 + 8)) {
      iVar8 = (**(code **)(**(int **)(puVar11 + 4) + 0xf0))();
    }
    else {
      iVar8 = (**(code **)(_DAT_00000000 + 0xf0))();
    }
    if (iVar8 == 0) {
      Warning();
    }
    else {
      pcVar10 = *(char **)(this + 0x488);
      local_38 = (int *)0x0;
      if (pcVar10 == (char *)0x0) {
        pcVar10 = "";
      }
      uVar5 = *(uint *)(this + 0x444);
      if (((uVar5 != 0xffffffff) &&
          (puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar11 + 8) == uVar5 >> 0xc)) {
        local_38 = *(int **)(puVar11 + 4);
      }
      this_00 = (CBaseAnimating *)(**(code **)(*local_38 + 0xf0))();
      iVar8 = CBaseAnimating::LookupAttachment(this_00,pcVar10);
      *(int *)(this + 0x48c) = iVar8;
      if (iVar8 == 0) {
        Warning();
      }
    }
  }
LAB_00b1ab5e:
  if ((this_01 != (CBaseEntity *)0x0) && (((byte)this[0x148] & 4) != 0)) {
    CBasePlayer::EnableControl((CBasePlayer *)this_01,false);
  }
  if (*(char **)(this + 0x44c) == (char *)0x0) {
    *(undefined4 *)(this + 0x448) = 0;
    *(undefined4 *)(this + 0x458) = *(undefined4 *)(gpGlobals + 0xc);
  }
  else {
    piVar7 = (int *)CGlobalEntityList::FindEntityByName
                              ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,
                               *(char **)(this + 0x44c),(CBaseEntity *)0x0,pCVar13,
                               (CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
    iVar8 = gpGlobals;
    *(int **)(this + 0x448) = piVar7;
    *(undefined4 *)(this + 0x458) = *(undefined4 *)(iVar8 + 0xc);
    if (piVar7 != (int *)0x0) {
      if ((float)piVar7[0x47] != 0.0) {
        *(int *)(this + 0x460) = piVar7[0x47];
      }
      lVar14 = (longdouble)(**(code **)(*piVar7 + 0x150))();
      *(float *)(this + 0x458) = (float)lVar14 + *(float *)(this + 0x458);
    }
  }
  if (((byte)this[0x148] & 1) == 0) {
    CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
  }
  else {
    uVar5 = *(uint *)(this + 0x440);
    piVar7 = (int *)0x0;
    if (((uVar5 != 0xffffffff) &&
        (puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar11 + 8) == uVar5 >> 0xc)) {
      piVar7 = *(int **)(puVar11 + 4);
    }
    (**(code **)(*piVar7 + 0x234))();
    piVar12 = (int *)&stack0xffffffa0;
    UTIL_SetOrigin((CBaseEntity *)this,(Vector *)&local_28,false);
    uVar5 = *(uint *)(this + 0x440);
    if (((uVar5 == 0xffffffff) ||
        (puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar11 + 8) != uVar5 >> 0xc)) {
      iVar8 = 0;
      local_24 = _DAT_000003ac;
    }
    else {
      iVar8 = *(int *)(puVar11 + 4);
      local_24 = *(undefined4 *)(iVar8 + 0x3ac);
    }
    local_28 = *(undefined4 *)(iVar8 + 0x3a8);
    pCVar13 = (CBaseEntity *)0x0;
    local_20 = 0;
    CBaseEntity::SetLocalAngles((CBaseEntity *)this,(QAngle *)&local_28);
    uVar5 = *(uint *)(this + 0x440);
    if (((uVar5 != 0xffffffff) &&
        (puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar11 + 8) == uVar5 >> 0xc)) {
      pCVar13 = *(CBaseEntity **)(puVar11 + 4);
    }
    if (((byte)pCVar13[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity(pCVar13);
    }
    CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)(pCVar13 + 0x274));
  }
  if (this_01 != (CBaseEntity *)0x0) {
    piVar12[1] = (int)this;
    *piVar12 = (int)this_01;
    piVar12[-1] = 0xb1ad41;
    CBasePlayer::SetViewEntity((CBasePlayer *)*piVar12,(CBaseEntity *)piVar12[1]);
    if (*(CBasePlayer *)(this_01 + 0x1ac8) != (CBasePlayer)0x0) {
      iVar8 = *(int *)(this_01 + 0x1a40);
      *piVar12 = (int)(this_01 + 0x1a40);
      piVar12[1] = (int)(this_01 + 0x1ac8);
      pcVar3 = *(code **)(iVar8 + 4);
      piVar12[-1] = 0xb1ae2c;
      (*pcVar3)();
      *(CBasePlayer *)(this_01 + 0x1ac8) = (CBasePlayer)0x0;
    }
  }
  uVar5 = *(uint *)(this + 0x444);
  if ((((uVar5 != 0xffffffff) &&
       (puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar11 + 8) == uVar5 >> 0xc)) && (*(int *)(puVar11 + 4) != 0)) {
    piVar12[1] = (int)this;
    *piVar12 = (int)local_34;
    piVar12[5] = 0;
    piVar12[4] = 0;
    piVar12[2] = (int)FollowTarget;
    piVar12[3] = 0;
    piVar12[-1] = 0xb1afc2;
    CBaseEntity::ThinkSet((_func_void *)*piVar12,(float)piVar12[1],(char *)piVar12[2]);
    piVar12[2] = 0;
    uVar1 = *(undefined4 *)(gpGlobals + 0xc);
    *piVar12 = (int)this;
    piVar12[1] = uVar1;
    piVar12[-1] = 0xb1afe5;
    CBaseEntity::SetNextThink((CBaseEntity *)*piVar12,(float)piVar12[1],(char *)piVar12[2]);
  }
  *(undefined4 *)(this + 0x45c) = 0;
  *piVar12 = (int)this;
  piVar12[-1] = 0xb1ad91;
  Move((CTriggerCamera *)*piVar12);
  *piVar12 = (int)this;
  piVar12[-1] = 0xb1ad99;
  CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)*piVar12);
  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)