L L4D2node

CBasePropDoor::DoorOpen

0x007f3e50 · 1120 bytes · __thiscall

_ZN13CBasePropDoor8DoorOpenEP11CBaseEntity

Decompiled

undefined (2 params)

/* CBasePropDoor::DoorOpen(CBaseEntity*) */

void __thiscall CBasePropDoor::DoorOpen(CBasePropDoor *this,CBaseEntity *param_1)

{
  uint uVar1;
  CBaseEdict *this_00;
  CBasePropDoor *this_01;
  int *piVar2;
  char cVar3;
  undefined1 uVar4;
  char *pcVar5;
  int iVar6;
  int *piVar7;
  undefined4 uVar8;
  undefined *puVar9;
  int iVar10;
  code *pcVar11;
  bool bVar12;
  
  if (*(int *)(this + 0x15f4) - 1U < 2) {
    return;
  }
  cVar3 = CDirectorSessionManager::IsWaitingForTeamReady
                    (*(CDirectorSessionManager **)(TheDirector + 0x634));
  if (cVar3 == '\0') {
    if ((this[0x162e] != (CBasePropDoor)0x0) &&
       (piVar7 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                  (gameeventmanager,"rescue_door_open",0,0), piVar7 != (int *)0x0))
    {
      uVar1 = *(uint *)(this + 0x1620);
      if ((uVar1 == 0xffffffff) ||
         ((((puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc ||
            (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) ||
           (piVar2 = *(int **)(puVar9 + 4), piVar2 == (int *)0x0)) ||
          (cVar3 = (**(code **)(*piVar2 + 0x16c))(piVar2), cVar3 == '\0')))) {
        pcVar11 = *(code **)(*piVar7 + 0x30);
        uVar8 = 0;
      }
      else {
        pcVar11 = *(code **)(*piVar7 + 0x30);
        uVar8 = (**(code **)(*engine + 0x40))(engine,piVar2[0xc]);
      }
      (*pcVar11)(piVar7,"userid",uVar8);
      if (*(int *)(this + 0x30) == 0) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      (**(code **)(*piVar7 + 0x30))(piVar7,"entindex",iVar6);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar7,0);
    }
    this[0x162f] = (CBasePropDoor)0x0;
    RescueDisable(this,false);
    UpdateAreaPortals(this,true);
    iVar6 = *(int *)(this + 0x15f4);
    bVar12 = iVar6 == 0;
    if (((byte)this[0x149] & 0x10) == 0) {
      pcVar5 = "";
      if (*(char **)(this + 0x1648) != (char *)0x0) {
        pcVar5 = *(char **)(this + 0x1648);
      }
      CBaseEntity::EmitSound((CBaseEntity *)this,pcVar5,0.0,(float *)0x0);
      uVar1 = *(uint *)(this + 0x1620);
      if ((((uVar1 != 0xffffffff) &&
           (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
          ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc &&
           ((piVar7 = *(int **)(puVar9 + 4), piVar7 != (int *)0x0 &&
            (cVar3 = (**(code **)(*piVar7 + 0x16c))(piVar7), cVar3 != '\0')))))) &&
         (((byte)this[0x149] & 0x40) == 0)) {
        if (((byte)this[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
        }
        CSoundEnt::InsertSound
                  (4,(Vector *)(this + 0x2e0),0x200,0.5,(CBaseEntity *)this,0,(CBaseEntity *)0x0);
      }
      iVar6 = *(int *)(this + 0x15f4);
    }
    if (iVar6 != 1) {
      if (this[0x6c] == (CBasePropDoor)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBasePropDoor)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x15f4) = 1;
    }
    *(code **)(this + 0x14) = DoorOpenMoveDone;
    *(undefined4 *)(this + 0x18) = 0;
    (**(code **)(*(int *)this + 0x4ac))(this,param_1);
    piVar7 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"door_open",0,0);
    if (piVar7 != (int *)0x0) {
      uVar1 = *(uint *)(this + 0x1620);
      if ((((uVar1 == 0xffffffff) ||
           (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
          (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) ||
         ((piVar2 = *(int **)(puVar9 + 4), piVar2 == (int *)0x0 ||
          (cVar3 = (**(code **)(*piVar2 + 0x16c))(piVar2), cVar3 == '\0')))) {
        pcVar11 = *(code **)(*piVar7 + 0x30);
        uVar8 = 0;
      }
      else {
        pcVar11 = *(code **)(*piVar7 + 0x30);
        uVar8 = (**(code **)(*engine + 0x40))(engine,piVar2[0xc]);
      }
      (*pcVar11)(piVar7,"userid",uVar8);
      pcVar11 = *(code **)(*piVar7 + 0x30);
      uVar4 = (**(code **)(*(int *)this + 0x478))(this);
      (*pcVar11)(piVar7,"checkpoint",uVar4);
      (**(code **)(*piVar7 + 0x2c))(piVar7,"closed",bVar12);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar7,0);
    }
    COutputEvent::FireOutput
              ((COutputEvent *)(this + 0x1714),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
    iVar6 = *(int *)(this + 0x15e8);
    if (0 < iVar6) {
      iVar10 = 0;
      do {
        while (((uVar1 = *(uint *)(*(int *)(this + 0x15dc) + iVar10 * 4), uVar1 != 0xffffffff &&
                (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)
                ) && ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc &&
                      (this_01 = *(CBasePropDoor **)(puVar9 + 4), this_01 != (CBasePropDoor *)0x0)))
               )) {
          iVar10 = iVar10 + 1;
          *(undefined4 *)(this_01 + 0x1620) = *(undefined4 *)(this + 0x1620);
          DoorOpen(this_01,param_1);
          if (iVar10 == iVar6) {
            return;
          }
        }
        iVar10 = iVar10 + 1;
      } while (iVar10 != iVar6);
    }
    return;
  }
  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)