L L4D2node

CPropDoorRotating::BeginOpening

0x007fbc30 · 2140 bytes · __thiscall

_ZN17CPropDoorRotating12BeginOpeningEP11CBaseEntity

Decompiled

undefined (2 params)

/* CPropDoorRotating::BeginOpening(CBaseEntity*) */

void __thiscall CPropDoorRotating::BeginOpening(CPropDoorRotating *this,CBaseEntity *param_1)

{
  CBaseEntity CVar1;
  CPropDoorRotating CVar2;
  uint uVar3;
  char cVar4;
  float *pfVar5;
  int *piVar6;
  undefined4 *puVar7;
  Vector *pVVar8;
  Vector *pVVar9;
  undefined *puVar10;
  int iVar11;
  longdouble lVar12;
  float fVar13;
  float fVar14;
  undefined4 local_70;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  float local_58;
  float local_54;
  float local_50;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  local_64 = *(undefined4 *)(this + 0x1774);
  local_60 = *(undefined4 *)(this + 0x1778);
  local_5c = *(undefined4 *)(this + 0x177c);
  if (*(int *)(this + 0x1758) == 1) {
LAB_007fc078:
    local_64 = *(undefined4 *)(this + 0x1774);
    local_60 = *(undefined4 *)(this + 0x1778);
    local_5c = *(undefined4 *)(this + 0x177c);
    goto LAB_007fc0a5;
  }
  if (*(int *)(this + 0x1758) == 2) {
LAB_007fc230:
    local_64 = *(undefined4 *)(this + 0x1780);
    local_60 = *(undefined4 *)(this + 0x1784);
    local_5c = *(undefined4 *)(this + 0x1788);
  }
  else {
    iVar11 = 0;
    if (param_1 != (CBaseEntity *)0x0) {
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      pfVar5 = (float *)(**(code **)(*(int *)this + 0x288))(this);
      local_34 = *pfVar5 - *(float *)(this + 0x2e0);
      local_2c = 0.0;
      local_30 = pfVar5[1] - *(float *)(this + 0x2e4);
      VectorNormalize((Vector *)&local_34);
      if (((byte)this[0x14d] & 8) == 0) {
        CVar1 = param_1[0x14d];
      }
      else {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
        CVar1 = param_1[0x14d];
      }
      if (((byte)CVar1 & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(param_1);
      }
      local_20 = 0.0;
      local_28 = *(float *)(param_1 + 0x2e0) - *(float *)(this + 0x2e0);
      local_24 = *(float *)(param_1 + 0x2e4) - *(float *)(this + 0x2e4);
      VectorNormalize((Vector *)&local_28);
      fVar13 = local_34 * local_24;
      fVar14 = local_28 * local_30;
      lVar12 = (longdouble)AngleNormalize(*(float *)(this + 0x1778) - *(float *)(this + 0x3ac));
      iVar11 = 0;
      if (0.0 <= fVar13 - fVar14 == 0.0 <= (float)lVar12) {
        local_64 = *(undefined4 *)(this + 0x1780);
        iVar11 = 1;
        local_60 = *(undefined4 *)(this + 0x1784);
        local_5c = *(undefined4 *)(this + 0x1788);
      }
    }
    uVar3 = *(uint *)(this + 0x1628);
    if (((((uVar3 == 0xffffffff) ||
          (puVar10 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar10 + 8) != uVar3 >> 0xc)) || (*(int *)(puVar10 + 4) == 0)) &&
       (((((uVar3 = *(uint *)(this + 0x1620), uVar3 != 0xffffffff &&
           (puVar10 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
          && ((*(uint *)(puVar10 + 8) == uVar3 >> 0xc &&
              ((piVar6 = *(int **)(puVar10 + 4), piVar6 != (int *)0x0 &&
               (cVar4 = (**(code **)(*piVar6 + 0x16c))(piVar6), cVar4 != '\0')))))) &&
         (param_1 != (CBaseEntity *)0x0)) &&
        ((cVar4 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar4 != '\0' &&
         (cVar4 = CheckDoorClear(this,iVar11), cVar4 == '\0')))))) {
      if (iVar11 != 0) {
        local_64 = *(undefined4 *)(this + 0x1774);
        local_60 = *(undefined4 *)(this + 0x1778);
        local_5c = *(undefined4 *)(this + 0x177c);
        cVar4 = CheckDoorClear(this,0);
        if (cVar4 == '\0') goto LAB_007fc230;
        goto LAB_007fc0a5;
      }
      local_64 = *(undefined4 *)(this + 0x1780);
      local_60 = *(undefined4 *)(this + 0x1784);
      local_5c = *(undefined4 *)(this + 0x1788);
      cVar4 = CheckDoorClear(this,1);
      if (cVar4 == '\0') goto LAB_007fc078;
    }
    else if (iVar11 == 0) {
LAB_007fc0a5:
      local_58 = *(float *)(this + 0x1798);
      local_70 = 0;
      local_54 = *(float *)(this + 0x179c);
      local_50 = *(float *)(this + 0x17a0);
      local_4c = *(float *)(this + 0x17a4);
      local_48 = *(float *)(this + 0x17a8);
      local_44 = *(float *)(this + 0x17ac);
      goto LAB_007fbe41;
    }
  }
  local_58 = *(float *)(this + 0x17b0);
  local_70 = 1;
  local_54 = *(float *)(this + 0x17b4);
  local_50 = *(float *)(this + 0x17b8);
  local_4c = *(float *)(this + 0x17bc);
  local_48 = *(float *)(this + 0x17c0);
  local_44 = *(float *)(this + 0x17c4);
LAB_007fbe41:
  uVar3 = *(uint *)(this + 0x17c8);
  if ((((uVar3 != 0xffffffff) &&
       (puVar10 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar10 + 8) == uVar3 >> 0xc)) &&
     (*(CBaseEntity **)(puVar10 + 4) != (CBaseEntity *)0x0)) {
    UTIL_Remove(*(CBaseEntity **)(puVar10 + 4));
  }
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  piVar6 = (int *)CEntityBlocker::Create
                            ((Vector *)(this + 0x2e0),(Vector *)&local_58,(Vector *)&local_4c,
                             param_1,false);
  if (piVar6 == (int *)0x0) {
    CVar2 = this[0x14d];
    *(undefined4 *)(this + 0x17c8) = 0xffffffff;
  }
  else {
    puVar7 = (undefined4 *)(**(code **)(*piVar6 + 0xc))(piVar6);
    CVar2 = this[0x14d];
    *(undefined4 *)(this + 0x17c8) = *puVar7;
  }
  if (((byte)CVar2 & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_40 = (local_4c + local_58) * 0.5 + *(float *)(this + 0x2e0);
  local_38 = (local_44 + local_50) * 0.5 + *(float *)(this + 0x2e8);
  local_3c = (local_48 + local_54) * 0.5 + *(float *)(this + 0x2e4);
  fVar13 = ABS(local_58);
  if (ABS(local_58) <= local_4c) {
    fVar13 = local_4c;
  }
  fVar14 = local_48;
  if (local_48 < ABS(local_54)) {
    fVar14 = ABS(local_54);
  }
  if (fVar13 <= fVar14) {
    fVar13 = fVar14;
  }
  if (*(int *)(g_debug_doors._28_4_ + 0x30) != 0) {
    local_34 = -fVar13;
    local_30 = local_34;
    local_2c = local_34;
    local_28 = fVar13;
    local_24 = fVar13;
    local_20 = fVar13;
    NDebugOverlay::Cross3D
              ((Vector *)&local_40,(Vector *)&local_34,(Vector *)&local_28,0xff,0,0,true,1.0);
  }
  if (((byte)this[0x149] & 0x40) == 0) {
    CSoundEnt::InsertSound(0x1000,(Vector *)&local_40,(int)fVar13,0.5,param_1,0,(CBaseEntity *)0x0);
  }
  uVar3 = *(uint *)(this + 0x17c8);
  if (((uVar3 != 0xffffffff) &&
      (puVar10 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar10 + 8) == uVar3 >> 0xc &&
      (*(CBaseEntity **)(puVar10 + 4) != (CBaseEntity *)0x0)))) {
    CBaseEntity::SetCollisionGroup(*(CBaseEntity **)(puVar10 + 4),0xe);
    cVar4 = CheckDoorClear(this,local_70);
    if (cVar4 == '\0') {
      uVar3 = *(uint *)(this + 0x17c8);
      iVar11 = 0;
      if (((uVar3 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar3 >> 0xc)) {
        iVar11 = *(int *)(puVar10 + 4);
      }
      CCollisionProperty::SetSolidFlags
                ((CCollisionProperty *)(iVar11 + 0x194),(uint)(*(ushort *)(iVar11 + 0x1b4) | 4));
    }
    if (*(int *)(g_debug_doors._28_4_ + 0x30) != 0) {
      uVar3 = *(uint *)(this + 0x17c8);
      iVar11 = 0;
      if (((uVar3 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar3 >> 0xc)) {
        iVar11 = *(int *)(puVar10 + 4);
      }
      pVVar8 = (Vector *)(**(code **)(*(int *)(iVar11 + 0x194) + 8))(iVar11 + 0x194);
      iVar11 = 0;
      uVar3 = *(uint *)(this + 0x17c8);
      if (((uVar3 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar3 >> 0xc)) {
        iVar11 = *(int *)(puVar10 + 4);
      }
      pVVar9 = (Vector *)(**(code **)(*(int *)(iVar11 + 0x194) + 4))(iVar11 + 0x194);
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      NDebugOverlay::Box((Vector *)(this + 0x2e0),pVVar9,pVVar8,0xff,0,0,1,1.0);
    }
  }
  AngularMove(this,(QAngle *)&local_64,*(float *)(this + 0x11c));
  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)