L L4D2node

CBaseDoor::DoorGoUp

0x006689e0 · 1273 bytes · __thiscall

_ZN9CBaseDoor8DoorGoUpEv

Decompiled

undefined (1 param)

/* CBaseDoor::DoorGoUp() */

void __thiscall CBaseDoor::DoorGoUp(CBaseDoor *this)

{
  CBaseEntity CVar1;
  char cVar2;
  float *pfVar3;
  undefined4 *puVar4;
  uint uVar5;
  undefined *puVar6;
  CBaseEntity *this_00;
  CBaseEntity *pCVar7;
  uint uVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float local_64;
  float local_60;
  float local_40;
  float local_3c;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  UpdateAreaPortals(this,true);
  if ((((byte)this[0x149] & 0x10) == 0) && (1 < *(int *)(this + 0x440) - 2U)) {
    StartMovingSound(this);
  }
  *(code **)(this + 0x14) = DoorHitTop;
  *(undefined4 *)(this + 0x440) = 2;
  *(undefined4 *)(this + 0x18) = 0;
  cVar2 = (**(code **)(*(int *)this + 0x330))(this);
  if (cVar2 == '\0') {
    CBaseToggle::LinearMove((CBaseToggle *)this,(Vector *)(this + 0x460),*(float *)(this + 0x11c));
    goto LAB_00668acb;
  }
  uVar8 = *(uint *)(this + 0x494);
  if (uVar8 == 0xffffffff) {
LAB_00668a77:
    local_20 = 1.0;
  }
  else {
    uVar5 = uVar8 & 0xfff;
    puVar4 = (undefined4 *)(g_pEntityList + uVar5 * 0x10 + 4);
    if ((((puVar4 == (undefined4 *)0x0) ||
         (*(uint *)(g_pEntityList + uVar5 * 0x10 + 8) != uVar8 >> 0xc)) ||
        (*(int *)(g_pEntityList + uVar5 * 0x10 + 4) == 0)) ||
       ((((byte)this[0x148] & 0x10) != 0 || (*(float *)(this + 0x470) == 0.0)))) goto LAB_00668a77;
    if (((byte)this[0x14d] & 8) == 0) {
      local_64 = *(float *)(this + 0x2e0);
      local_60 = *(float *)(this + 0x2e4);
LAB_00668b6f:
      pCVar7 = (CBaseEntity *)*puVar4;
LAB_00668b71:
      CVar1 = pCVar7[0x14d];
    }
    else {
      pCVar7 = (CBaseEntity *)0x0;
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      uVar8 = *(uint *)(this + 0x494);
      local_64 = *(float *)(this + 0x2e0);
      local_60 = *(float *)(this + 0x2e4);
      if ((uVar8 == 0xffffffff) ||
         (puVar4 = (undefined4 *)(g_pEntityList + (uVar8 & 0xfff) * 0x10 + 4),
         puVar4 == (undefined4 *)0x0)) goto LAB_00668b71;
      CVar1 = CRam0000014d;
      if (puVar4[1] == uVar8 >> 0xc) goto LAB_00668b6f;
    }
    if (((byte)CVar1 & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar7);
    }
    this_00 = (CBaseEntity *)0x0;
    CCollisionProperty::CalcNearestPoint
              ((CCollisionProperty *)(this + 0x194),(Vector *)(pCVar7 + 0x2e0),(Vector *)&local_40);
    uVar8 = *(uint *)(this + 0x494);
    if (((uVar8 != 0xffffffff) &&
        (puVar6 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar6 + 8) == uVar8 >> 0xc)) {
      this_00 = *(CBaseEntity **)(puVar6 + 4);
    }
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
      uVar8 = *(uint *)(this + 0x494);
    }
    local_2c = 0.0;
    local_34 = local_40 - *(float *)(this_00 + 0x2e0);
    local_30 = local_3c - *(float *)(this_00 + 0x2e4);
    pCVar7 = (CBaseEntity *)0x0;
    if (((uVar8 != 0xffffffff) &&
        (puVar6 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar6 + 8) == uVar8 >> 0xc)) {
      pCVar7 = *(CBaseEntity **)(puVar6 + 4);
    }
    fVar11 = 0.0;
    if (((byte)pCVar7[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar7);
      fVar11 = local_2c * local_2c;
    }
    local_28 = local_64 - *(float *)(pCVar7 + 0x2e0);
    fVar10 = local_28 - local_34;
    local_24 = local_60 - *(float *)(pCVar7 + 0x2e4);
    local_20 = 0.0;
    fVar9 = local_24 - local_30;
    VectorNormalize((Vector *)&local_28);
    VectorNormalize((Vector *)&local_34);
    if ((SQRT(fVar9 * fVar9 + fVar10 * fVar10 + fVar11) < 5.0) &&
       (0.99 < local_30 * local_24 + local_34 * local_28 + local_2c * local_20)) {
      pCVar7 = (CBaseEntity *)0x0;
      pfVar3 = (float *)(**(code **)(*(int *)this + 0x288))(this);
      fVar11 = *pfVar3;
      fVar9 = pfVar3[1];
      uVar8 = *(uint *)(this + 0x494);
      if ((uVar8 != 0xffffffff) &&
         ((puVar6 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
          (*(uint *)(puVar6 + 8) == uVar8 >> 0xc)))) {
        pCVar7 = *(CBaseEntity **)(puVar6 + 4);
      }
      if (((byte)pCVar7[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar7);
      }
      local_20 = 0.0;
      local_24 = (local_60 - (fVar9 + *(float *)(pCVar7 + 0x2e4))) + local_60;
      local_28 = (local_64 - (fVar11 + *(float *)(pCVar7 + 0x2e0))) + local_64;
      VectorNormalize((Vector *)&local_28);
    }
    uVar8 = -(uint)(0.0 < local_30 * local_28 - local_24 * local_34);
    local_20 = (float)(~uVar8 & 0x3f800000 | uVar8 & 0xbf800000);
  }
  local_28 = *(float *)(this + 0x484) * local_20;
  local_24 = *(float *)(this + 0x488) * local_20;
  local_20 = local_20 * *(float *)(this + 0x48c);
  CBaseToggle::AngularMove((CBaseToggle *)this,(QAngle *)&local_28,*(float *)(this + 0x11c));
LAB_00668acb:
  COutputEvent::FireOutput
            ((COutputEvent *)(this + 0x5c8),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
  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)