L L4D2node

CFuncElevator::PhysicsSimulate

0x006bc5d0 · 1899 bytes · __thiscall

_ZN13CFuncElevator15PhysicsSimulateEv

Decompiled

undefined (1 param)

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

void __thiscall CFuncElevator::PhysicsSimulate(CFuncElevator *this)

{
  float fVar1;
  CBaseEntity *this_00;
  bool bVar2;
  char cVar3;
  int iVar4;
  int *piVar5;
  uint uVar6;
  int iVar7;
  Vector *pVVar8;
  longdouble lVar9;
  float fVar10;
  float local_300;
  undefined4 local_2fc;
  undefined4 local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  int local_2ec;
  Vector local_2e8 [8];
  float local_2e0;
  Vector local_2dc [8];
  float local_2d4;
  undefined4 local_2d0;
  undefined4 local_2cc;
  float local_2c8;
  undefined4 local_2c4;
  undefined4 local_2c0;
  float local_2bc;
  float local_2b8;
  float local_2b4;
  float local_2b0;
  float local_2ac;
  float local_2a8;
  float local_2a4;
  float local_2a0;
  float local_29c;
  float local_298;
  undefined **local_294 [4];
  undefined **local_284 [4];
  int local_274;
  CGameTrace local_270 [44];
  float local_244;
  CBaseEntity *local_21c [131];
  
  if (*(int *)(this + 300) == *(int *)(gpGlobals + 0x18)) {
    return;
  }
  *(int *)(this + 300) = *(int *)(gpGlobals + 0x18);
  local_2fc = 0;
  local_2f8 = 0;
  if (___atan2f_finite == 0) {
    local_2ec = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_2fc,0,0,0,0,"/data/src/game/server/func_elevator.cpp",0x309,
               &PhysicsSimulate()::tm_fmt,"(%s)%s","Unaccounted","CFuncElevator::PhysicsSimulate");
    local_2ec = ___atan2f_finite;
  }
  iVar7 = _DAT_0105db00;
  local_2f4 = local_2fc;
  local_2f0 = local_2f8;
                    /* try { // try from 006bc786 to 006bc7d4 has its CatchHandler @ 006bcd8a */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(), iVar7 == iVar4)) {
    if ((char *)*_DAT_0105d15c != "CFuncElevator::PhysicsSimulate") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc8d314,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 006bc6c4 to 006bc6c8 has its CatchHandler @ 006bcd66 */
  CBaseEntity::PhysicsRunThink(this,0);
  if (this[0x4fc] == (CFuncElevator)0x0) {
    *(undefined4 *)(this + 0x500) = 0;
    goto LAB_006bc6e0;
  }
                    /* try { // try from 006bc7fd to 006bcd60 has its CatchHandler @ 006bcd66 */
  piVar5 = (int *)(**(code **)(*(int *)this + 0x10))(this);
  (**(code **)(*piVar5 + 0x3c))(piVar5,local_2e8,local_2dc);
  local_2d4 = local_2d4 + 71.0;
  local_2e0 = local_2e0 - 71.0;
  CFlaggedEntitiesEnum::CFlaggedEntitiesEnum((CFlaggedEntitiesEnum *)local_284,local_21c,0x80,0);
  local_284[0] = &PTR_EnumElement_00c8dbd8;
  UTIL_EntitiesInBox(local_2e8,local_2dc,(CFlaggedEntitiesEnum *)local_284);
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_2d0 = *(undefined4 *)(this + 0x2e0);
  local_2cc = *(undefined4 *)(this + 0x2e4);
  local_2c8 = *(float *)(this + 0x2e8);
  local_2c4 = local_2d0;
  local_2c0 = local_2cc;
  local_2bc = local_2c8;
  lVar9 = (longdouble)GetCurrentHeight(this,"CFuncElevator::PhysicsSimulate");
  fVar1 = (float)lVar9;
  fVar10 = *(float *)(this + 0x4f4);
  local_2bc = *(float *)(this + 0x4f8);
  if (fVar10 == local_2bc) {
LAB_006bc92d:
    fVar10 = *(float *)(this + 0x50c);
    if (fVar10 == -1.0) {
      fVar10 = *(float *)(gpGlobals + 0xc);
      *(float *)(this + 0x50c) = fVar10;
    }
  }
  else {
    if (fVar10 <= local_2bc) {
      if ((local_2bc <= fVar10) || (fVar1 < local_2bc)) goto LAB_006bcc10;
      goto LAB_006bc92d;
    }
    if ((fVar1 <= local_2bc) || (fVar10 < local_2bc)) goto LAB_006bc92d;
LAB_006bcc10:
    fVar10 = *(float *)(this + 0x50c);
    local_2bc = fVar1;
  }
  local_300 = local_2bc - local_2c8;
  if ((fVar10 == -1.0) ||
     (fVar10 = fVar10 + *(float *)(elevator_movedelay._28_4_ + 0x2c),
     *(float *)(gpGlobals + 0xc) <= fVar10 && fVar10 != *(float *)(gpGlobals + 0xc))) {
    bVar2 = false;
  }
  else {
    *(undefined4 *)(this + 0x50c) = 0xbf800000;
    bVar2 = true;
  }
  CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)&local_2c4);
  CBaseEntity::PhysicsTouchTriggers((CBaseEntity *)this,(Vector *)&local_2d0);
  (**(code **)(*(int *)this + 0x2b4))(this,*(undefined4 *)(gpGlobals + 0x10));
  if (bVar2) {
    (**(code **)(*(int *)this + 0xe0))(this);
  }
  if (0 < local_274) {
    iVar7 = 0;
    do {
      this_00 = local_21c[iVar7];
      cVar3 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
      if (cVar3 == '\0') {
        if (((byte)this_00[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(this_00);
        }
        local_2a4 = *(float *)(this_00 + 0x2e8);
        local_2b8 = *(float *)(this_00 + 0x2e0);
        local_2b4 = *(float *)(this_00 + 0x2e4);
        local_2b0 = local_300 + local_2a4;
        local_2ac = local_2b8;
        local_2a8 = local_2b4;
        CTraceFilterSimple::CTraceFilterSimple
                  ((CTraceFilterSimple *)local_294,(IHandleEntity *)this_00,8,
                   (_func_bool_IHandleEntity_ptr_int *)0x0);
        local_294[0] = &PTR_ShouldHitEntity_00c8dbe8;
        uVar6 = (**(code **)(*(int *)this_00 + 0x2c8))(this_00);
        pVVar8 = (Vector *)&local_2b8;
        UTIL_TraceEntity(this_00,pVVar8,pVVar8,uVar6,(ITraceFilter *)local_294,local_270);
        if (local_244 == 1.0) {
LAB_006bcbbe:
          CBaseEntity::SetAbsOrigin(this_00,pVVar8);
          CBaseEntity::PhysicsTouchTriggers(this_00,(Vector *)&local_2ac);
        }
        else {
          local_2a0 = local_2b8 + 8.0;
          local_29c = local_2b4 + 8.0;
          local_298 = local_2b0;
          uVar6 = (**(code **)(*(int *)this_00 + 0x2c8))(this_00);
          pVVar8 = (Vector *)&local_2a0;
          UTIL_TraceEntity(this_00,pVVar8,pVVar8,uVar6,(ITraceFilter *)local_294,local_270);
          if (local_244 != 1.0) {
            local_2a0 = local_2b8 - 8.0;
            local_29c = local_2b4 - 8.0;
            local_298 = local_2b0;
            uVar6 = (**(code **)(*(int *)this_00 + 0x2c8))(this_00);
            UTIL_TraceEntity(this_00,pVVar8,pVVar8,uVar6,(ITraceFilter *)local_294,local_270);
            if (local_244 != 1.0) {
              local_2a0 = local_2b8;
              local_29c = local_2b4;
              local_298 = local_2b0 - (local_300 + local_300);
              uVar6 = (**(code **)(*(int *)this_00 + 0x2c8))(this_00);
              UTIL_TraceEntity(this_00,pVVar8,pVVar8,uVar6,(ITraceFilter *)local_294,local_270);
              if (local_244 != 1.0) goto LAB_006bcbbe;
            }
          }
        }
      }
      iVar7 = iVar7 + 1;
    } while (iVar7 < local_274);
  }
LAB_006bc6e0:
  iVar7 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(), iVar7 == iVar4)) {
    cVar3 = CVProfNode::ExitScope();
    if (cVar3 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_2ec != 0) {
    (**(code **)(local_2ec + 0x54))(local_2ec,local_2f4,local_2f0,0,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)