L L4D2node

CPhysicsPushedEntities::SpeculativelyCheckPush

0x0078c240 · 2220 bytes · __thiscall

_ZN22CPhysicsPushedEntities22SpeculativelyCheckPushERNS_19PhysicsPushedInfo_tERK6VectorbP11CBaseEntity

Decompiled

undefined (5 params)

/* CPhysicsPushedEntities::SpeculativelyCheckPush(CPhysicsPushedEntities::PhysicsPushedInfo_t&,
   Vector const&, bool, CBaseEntity*) */

PhysicsPushedInfo_t * __thiscall
CPhysicsPushedEntities::SpeculativelyCheckPush
          (CPhysicsPushedEntities *this,PhysicsPushedInfo_t *param_1,Vector *param_2,bool param_3,
          CBaseEntity *param_4)

{
  code *pcVar1;
  undefined1 *puVar2;
  code *pcVar3;
  int iVar4;
  CBaseEntity *pCVar5;
  byte bVar6;
  char cVar7;
  PhysicsPushedInfo_t PVar8;
  uint uVar9;
  int iVar10;
  undefined4 uVar11;
  PhysicsPushedInfo_t *pPVar12;
  undefined1 *puVar13;
  uint uVar14;
  PhysicsPushedInfo_t *pPVar15;
  undefined1 *puVar16;
  int iVar17;
  int in_GS_OFFSET;
  PhysicsPushedInfo_t *pPVar18;
  float fVar19;
  float fVar20;
  float fVar21;
  float fVar22;
  undefined3 in_stack_00000011;
  int aiStack_c0 [8];
  int local_a0;
  float local_9c;
  float local_98;
  float local_94;
  uint local_90;
  float *local_8c;
  CBaseEntity *local_88;
  PhysicsPushedInfo_t *local_84;
  PhysicsPushedInfo_t *local_80;
  float local_70;
  float local_6c;
  float local_68;
  float local_64;
  float local_60;
  float 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;
  undefined **local_34 [4];
  undefined4 local_24;
  int local_20;
  
  pPVar15 = *(PhysicsPushedInfo_t **)param_1;
  local_80 = param_1;
  local_8c = _param_3;
  local_88 = param_4;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar4 = -((*(int *)(this + 0x10) * 4 + 0xfU & 0xfffffff0) + 0x10);
  *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
  local_84 = (PhysicsPushedInfo_t *)((int)&local_a0 + iVar4);
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) =
       (PhysicsPushedInfo_t *)((int)&local_a0 + iVar4);
  *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c2a4;
  UnlinkPusherList(*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                   *(int **)((int)aiStack_c0 + iVar4 + 8));
  *(undefined4 *)((int)aiStack_c0 + iVar4 + 0x10) = 0;
  iVar10 = *(int *)(pPVar15 + 0x234);
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
  *(int *)((int)aiStack_c0 + iVar4 + 0xc) = iVar10;
  *(undefined ****)((int)aiStack_c0 + iVar4 + 4) = local_34;
  *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c2c5;
  CTraceFilterSimple::CTraceFilterSimple
            (*(CTraceFilterSimple **)((int)aiStack_c0 + iVar4 + 4),
             *(IHandleEntity **)((int)aiStack_c0 + iVar4 + 8),
             *(int *)((int)aiStack_c0 + iVar4 + 0xc),
             *(_func_bool_IHandleEntity_ptr_int **)((int)aiStack_c0 + iVar4 + 0x10));
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
  local_34[0] = &PTR_ShouldHitEntity_00cb2558;
  *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c2d4;
  local_24 = CBaseEntity::GetRootMoveParent(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
  if (((byte)pPVar15[0x14d] & 8) != 0) {
    *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
    *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c728;
    CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
  }
  local_70 = *(float *)param_2 + *(float *)(pPVar15 + 0x2e0);
  local_6c = *(float *)(param_2 + 4) + *(float *)(pPVar15 + 0x2e4);
  pPVar12 = local_80 + 0x10;
  local_68 = *(float *)(param_2 + 8) + *(float *)(pPVar15 + 0x2e8);
  iVar10 = *(int *)pPVar15;
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
  pcVar1 = *(code **)(iVar10 + 0x2c8);
  *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c32a;
  uVar9 = (*pcVar1)();
  if (((byte)pPVar15[0x14d] & 8) != 0) {
    *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
    local_90 = uVar9;
    *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c8e6;
    CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
    uVar9 = local_90;
  }
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 0x18) = pPVar12;
  *(uint *)((int)aiStack_c0 + iVar4 + 0x10) = uVar9;
  *(undefined ****)((int)aiStack_c0 + iVar4 + 0x14) = local_34;
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15 + 0x2e0;
  *(float **)((int)aiStack_c0 + iVar4 + 0xc) = &local_70;
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
  *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c35f;
  UTIL_TraceEntity(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
                   *(Vector **)((int)aiStack_c0 + iVar4 + 8),
                   *(Vector **)((int)aiStack_c0 + iVar4 + 0xc),
                   *(uint *)((int)aiStack_c0 + iVar4 + 0x10),
                   *(ITraceFilter **)((int)aiStack_c0 + iVar4 + 0x14),
                   *(CGameTrace **)((int)aiStack_c0 + iVar4 + 0x18));
  pPVar12 = local_84;
  *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar12;
  *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c36e;
  RelinkPusherList(*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                   *(int **)((int)aiStack_c0 + iVar4 + 8));
  local_80[0x65] = (PhysicsPushedInfo_t)0x0;
  *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
  *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c37d;
  iVar10 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
  if (iVar10 != 0) {
    *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
    *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c389;
    uVar11 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
    *(undefined4 *)((int)aiStack_c0 + iVar4 + 4) = uVar11;
    *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c391;
    iVar10 = CBaseEntity::GetRootMoveParent(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
    if (iVar10 == **(int **)(this + 4)) {
      local_80[0x65] = (PhysicsPushedInfo_t)0x1;
    }
  }
  if (((byte)pPVar15[0x14d] & 8) != 0) {
    *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
    *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c8d0;
    CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
  }
  local_64 = *(float *)(pPVar15 + 0x2e0);
  local_60 = *(float *)(pPVar15 + 0x2e4);
  local_5c = *(float *)(pPVar15 + 0x2e8);
  if (this[0x30] == (CPhysicsPushedEntities)0x0) {
LAB_0078c3ce:
    if (local_88 != (CBaseEntity *)0x0) {
      fVar22 = *(float *)local_88;
      *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4) = local_88;
      *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
      pcVar1 = *(code **)((int)fVar22 + 0x2c0);
      *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c3ed;
      pPVar12 = (PhysicsPushedInfo_t *)(*pcVar1)();
      if ((char)pPVar12 == '\0') {
        local_80[100] = (PhysicsPushedInfo_t)0x1;
        goto LAB_0078c3fa;
      }
    }
    pPVar12 = local_80;
    pPVar18 = (PhysicsPushedInfo_t *)0x0;
    if (*(float *)(local_80 + 0x3c) != 0.0) {
      *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
      local_84 = (PhysicsPushedInfo_t *)0x0;
      *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar12 + 0x1c;
      *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c937;
      CBaseEntity::SetAbsOrigin
                (*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
                 *(Vector **)((int)aiStack_c0 + iVar4 + 8));
      pPVar18 = local_84;
    }
    if ((((float)pPVar18 != *(float *)(pPVar15 + 0x1b8)) &&
        (pPVar15[0x1b6] != (PhysicsPushedInfo_t)0x0)) &&
       ((*(ushort *)(pPVar15 + 0x1b4) & 0x24) == 0)) {
      if (((char)local_8c == '\0') && (*(float *)(local_80 + 0x3c) == 1.0)) {
        *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
        *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
        *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c6dc;
        cVar7 = IsPushedPositionValid
                          (*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                           *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 8));
        if (cVar7 == '\0') {
          puVar2 = *(undefined1 **)(pPVar15 + 0x7c);
          puVar16 = *(undefined1 **)(**(int **)(this + 4) + 0x7c);
          *(char **)((int)aiStack_c0 + iVar4 + 4) = "Interpenetrating entities! (%s and %s)\n";
          if (puVar16 == (undefined1 *)0x0) {
            puVar16 = &DAT_00d539c2;
          }
          puVar13 = &DAT_00d539c2;
          if (puVar2 != (undefined1 *)0x0) {
            puVar13 = puVar2;
          }
          *(undefined1 **)((int)aiStack_c0 + iVar4 + 0xc) = puVar16;
          *(undefined1 **)((int)aiStack_c0 + iVar4 + 8) = puVar13;
          *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c70e;
          Warning();
        }
      }
      else {
        *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
        *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
        *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c47b;
        bVar6 = IsPushedPositionValid
                          (*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                           *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 8));
        local_98 = (float)(CONCAT31(local_98._1_3_,bVar6) ^ 1);
        local_80[100] = (PhysicsPushedInfo_t)(bVar6 ^ 1);
        if ((PhysicsPushedInfo_t)(bVar6 ^ 1) != (PhysicsPushedInfo_t)0x0) {
          if (((byte)pPVar15[0x14d] & 8) != 0) {
            *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
            *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c9c0;
            CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
          }
          local_58 = *(float *)(pPVar15 + 0x2e0);
          local_54 = *(float *)(pPVar15 + 0x2e4);
          fVar22 = *(float *)(pPVar15 + 0x2e8);
          *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
          local_50 = fVar22;
          *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c4cd;
          pPVar12 = (PhysicsPushedInfo_t *)
                    CBaseEntity::GetGroundEntity(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
          if ((pPVar12 != (PhysicsPushedInfo_t *)0x0) && (pPVar12 != g_WorldEntity)) {
            if (((byte)pPVar12[0x14d] & 8) != 0) {
              *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar12;
              local_84 = pPVar12;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78cacb;
              CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
              pPVar12 = local_84;
            }
            local_4c = *(float *)(pPVar12 + 0x2e0) - local_58;
            local_44 = 0.0;
            local_48 = *(float *)(pPVar12 + 0x2e4) - local_54;
            if ((((local_4c <= -0.01) || (0.01 <= local_4c)) || (local_48 <= -0.01)) ||
               (0.01 <= local_48)) {
              *(float **)((int)aiStack_c0 + iVar4 + 4) = &local_4c;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c53e;
              VectorNormalize(*(Vector **)((int)aiStack_c0 + iVar4 + 4));
              fVar22 = local_48;
              *(float **)((int)aiStack_c0 + iVar4 + 8) = &local_40;
              fVar19 = local_44;
              *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
              local_3c = fVar22 * 16.0 + local_54;
              local_38 = fVar19 * 16.0 + local_50;
              local_40 = local_4c * 16.0 + local_58;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c58c;
              CBaseEntity::SetAbsOrigin
                        (*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
                         *(Vector **)((int)aiStack_c0 + iVar4 + 8));
              *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
              *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c598;
              bVar6 = IsPushedPositionValid
                                (*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                                 *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 8));
              local_80[100] = (PhysicsPushedInfo_t)(bVar6 ^ 1);
              if ((PhysicsPushedInfo_t)(bVar6 ^ 1) == (PhysicsPushedInfo_t)0x0) {
                *(char **)((int)aiStack_c0 + iVar4 + 8) =
                     "Fixing player blocking train by moving to center!\n";
                *(undefined4 *)((int)aiStack_c0 + iVar4 + 4) = 1;
                *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78cb3c;
                DevMsg();
                pPVar12 = (PhysicsPushedInfo_t *)((uint)local_98 & 0xff);
                goto LAB_0078c3fa;
              }
            }
          }
          iVar10 = *(int *)pPVar15;
          *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
          pcVar1 = *(code **)(iVar10 + 0x16c);
          *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c5b4;
          cVar7 = (*pcVar1)();
          if (cVar7 == '\0') {
            uVar9 = 0;
            local_94 = (float)((uint)local_94 & 0xffffff00);
            local_88 = (CBaseEntity *)&local_4c;
            local_8c = &local_40;
            do {
              pPVar12 = (PhysicsPushedInfo_t *)**(undefined4 **)(this + 4);
              uVar14 = (int)uVar9 >> 1;
              if (((byte)pPVar12[0x14d] & 8) != 0) {
                *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar12;
                local_90 = (int)uVar9 >> 1;
                local_84 = pPVar12;
                *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c969;
                CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
                pPVar12 = local_84;
                uVar14 = local_90;
              }
              pCVar5 = local_88;
              *(uint *)((int)aiStack_c0 + iVar4 + 8) = uVar14;
              *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar12 + 0x28c;
              *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 0xc) = pCVar5;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c609;
              MatrixGetColumn(*(matrix3x4_t **)((int)aiStack_c0 + iVar4 + 4),
                              *(int *)((int)aiStack_c0 + iVar4 + 8),
                              *(Vector **)((int)aiStack_c0 + iVar4 + 0xc));
              fVar22 = local_48;
              fVar19 = 0.5;
              if ((uVar9 & 1) != 0) {
                fVar19 = -0.5;
              }
              *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
              fVar21 = local_44 * fVar19;
              fVar20 = fVar19 * local_4c;
              fVar22 = fVar22 * fVar19 + local_54;
              *(float **)((int)aiStack_c0 + iVar4 + 8) = local_8c;
              local_3c = fVar22;
              local_38 = fVar21 + local_50;
              local_40 = fVar20 + local_58;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c668;
              CBaseEntity::SetAbsOrigin
                        (*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
                         *(Vector **)((int)aiStack_c0 + iVar4 + 8));
              *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
              *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c674;
              bVar6 = IsPushedPositionValid
                                (*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                                 *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 8));
              local_80[100] = (PhysicsPushedInfo_t)(bVar6 ^ 1);
              if ((PhysicsPushedInfo_t)(bVar6 ^ 1) == (PhysicsPushedInfo_t)0x0) {
                *(char **)((int)aiStack_c0 + iVar4 + 8) = "Fixing player blocking train!\n";
                *(undefined4 *)((int)aiStack_c0 + iVar4 + 4) = 1;
                *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78cb0c;
                DevMsg();
                pPVar12 = (PhysicsPushedInfo_t *)((uint)local_98 & 0xff);
                goto LAB_0078c3fa;
              }
              uVar9 = uVar9 + 1;
            } while (uVar9 != 4);
            pPVar12 = (PhysicsPushedInfo_t *)((uint)local_94 & 0xff);
            *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
            *(float **)((int)aiStack_c0 + iVar4 + 8) = &local_58;
            local_80 = pPVar12;
            *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c6aa;
            CBaseEntity::SetAbsOrigin
                      (*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
                       *(Vector **)((int)aiStack_c0 + iVar4 + 8));
            *(char **)((int)aiStack_c0 + iVar4 + 8) = "Blocked by player on train!\n";
            *(undefined4 *)((int)aiStack_c0 + iVar4 + 4) = 2;
            *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c6be;
            DevMsg();
            pPVar12 = local_80;
          }
          else {
            *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
            *(float **)((int)aiStack_c0 + iVar4 + 8) = &local_64;
            *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c9e7;
            CBaseEntity::SetAbsOrigin
                      (*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
                       *(Vector **)((int)aiStack_c0 + iVar4 + 8));
            pcVar1 = *(code **)(*(int *)g_pGameMovement + 0x30);
            pPVar12 = (PhysicsPushedInfo_t *)**(int **)(this + 4);
            iVar10 = *(int *)pPVar15;
            *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
            pcVar3 = *(code **)(iVar10 + 0x16c);
            local_84 = pPVar12;
            *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78ca04;
            cVar7 = (*pcVar3)();
            pPVar12 = (PhysicsPushedInfo_t *)0x0;
            if (cVar7 != '\0') {
              pPVar12 = pPVar15;
            }
            *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 0xc) = local_84;
            *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar12;
            *(undefined **)((int)aiStack_c0 + iVar4 + 4) = g_pGameMovement;
            *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78ca20;
            (*pcVar1)();
            if (((byte)pPVar15[0x14d] & 8) != 0) {
              *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78cb20;
              CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
            }
            if (((local_64 != *(float *)(pPVar15 + 0x2e0)) ||
                (local_60 != *(float *)(pPVar15 + 0x2e4))) ||
               (local_5c != *(float *)(pPVar15 + 0x2e8))) {
              *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
              *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
              *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78ca8c;
              pPVar15 = (PhysicsPushedInfo_t *)
                        IsPushedPositionValid
                                  (*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                                   *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 8));
              if ((char)pPVar15 != '\0') {
                local_80[100] = (PhysicsPushedInfo_t)0x0;
                local_84 = pPVar15;
                *(char **)((int)aiStack_c0 + iVar4 + 8) =
                     "Fixing player blocking train via gamemovement!\n";
                *(undefined4 *)((int)aiStack_c0 + iVar4 + 4) = 1;
                *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78cab0;
                DevMsg();
                pPVar12 = local_84;
                goto LAB_0078c3fa;
              }
            }
            local_80[100] = (PhysicsPushedInfo_t)0x1;
            *(char **)((int)aiStack_c0 + iVar4 + 8) = "Blocked by player on train!\n";
            *(undefined4 *)((int)aiStack_c0 + iVar4 + 4) = 2;
            *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78ca72;
            DevMsg();
            pPVar12 = (PhysicsPushedInfo_t *)0x0;
          }
          goto LAB_0078c3fa;
        }
      }
    }
  }
  else {
    iVar10 = *(int *)pPVar15;
    *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
    pcVar1 = *(code **)(iVar10 + 0x16c);
    *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c73b;
    cVar7 = (*pcVar1)();
    if (cVar7 == '\0') {
      *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
      *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c988;
      iVar10 = CBaseEntity::MyNPCPointer();
      if (iVar10 == 0) goto LAB_0078c3ce;
    }
    *(float **)((int)aiStack_c0 + iVar4 + 8) = &local_70;
    *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
    *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c74f;
    CBaseEntity::SetAbsOrigin
              (*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
               *(Vector **)((int)aiStack_c0 + iVar4 + 8));
    *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
    *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
    *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c75b;
    bVar6 = IsPushedPositionValid
                      (*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                       *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 8));
    local_90 = CONCAT31(local_90._1_3_,bVar6) ^ 1;
    local_80[100] = (PhysicsPushedInfo_t)(bVar6 ^ 1);
    if ((PhysicsPushedInfo_t)(bVar6 ^ 1) != (PhysicsPushedInfo_t)0x0) {
      if (((byte)pPVar15[0x14d] & 8) != 0) {
        *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
        *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c9d0;
        CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
      }
      local_88 = (CBaseEntity *)&local_4c;
      local_84 = pPVar15;
      uVar9 = 0;
      local_94 = *(float *)(pPVar15 + 0x2e0);
      local_9c = *(float *)(pPVar15 + 0x2e4);
      local_98 = *(float *)(pPVar15 + 0x2e8);
      local_8c = &local_40;
      do {
        iVar10 = **(int **)(this + 4);
        iVar17 = (int)uVar9 >> 1;
        if ((*(byte *)(iVar10 + 0x14d) & 8) != 0) {
          *(int *)((int)aiStack_c0 + iVar4 + 4) = iVar10;
          aiStack_c0[7] = (int)uVar9 >> 1;
          local_a0 = iVar10;
          *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c90c;
          CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4));
          iVar10 = local_a0;
          iVar17 = aiStack_c0[7];
        }
        pCVar5 = local_88;
        *(int *)((int)aiStack_c0 + iVar4 + 8) = iVar17;
        *(int *)((int)aiStack_c0 + iVar4 + 4) = iVar10 + 0x28c;
        *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 0xc) = pCVar5;
        *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c800;
        MatrixGetColumn(*(matrix3x4_t **)((int)aiStack_c0 + iVar4 + 4),
                        *(int *)((int)aiStack_c0 + iVar4 + 8),
                        *(Vector **)((int)aiStack_c0 + iVar4 + 0xc));
        fVar22 = 0.5;
        if ((uVar9 & 1) != 0) {
          fVar22 = -0.5;
        }
        fVar20 = local_48 * fVar22;
        fVar19 = local_44 * fVar22;
        *(float **)((int)aiStack_c0 + iVar4 + 8) = local_8c;
        fVar22 = fVar22 * local_4c;
        fVar20 = fVar20 + local_9c;
        fVar19 = fVar19 + local_98;
        *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = local_84;
        local_3c = fVar20;
        local_38 = fVar19;
        local_40 = fVar22 + local_94;
        *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c868;
        CBaseEntity::SetAbsOrigin
                  (*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
                   *(Vector **)((int)aiStack_c0 + iVar4 + 8));
        pPVar15 = local_84;
        *(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4) = this;
        *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 8) = pPVar15;
        *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c877;
        uVar14 = IsPushedPositionValid
                           (*(CPhysicsPushedEntities **)((int)aiStack_c0 + iVar4 + 4),
                            *(CBaseEntity **)((int)aiStack_c0 + iVar4 + 8));
        pPVar15 = local_84;
        PVar8 = SUB41((PhysicsPushedInfo_t *)(uVar14 ^ 1),0);
        local_80[100] = PVar8;
        if (PVar8 == (PhysicsPushedInfo_t)0x0) {
          *(char **)((int)aiStack_c0 + iVar4 + 8) = "Fixing player blocking train!\n";
          *(undefined4 *)((int)aiStack_c0 + iVar4 + 4) = 1;
          *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78caec;
          DevMsg();
          pPVar12 = (PhysicsPushedInfo_t *)(local_90 & 0xff);
          goto LAB_0078c3fa;
        }
        uVar9 = uVar9 + 1;
      } while (uVar9 != 4);
      *(float **)((int)aiStack_c0 + iVar4 + 8) = &local_70;
      local_80 = (PhysicsPushedInfo_t *)(uVar14 ^ 1);
      *(PhysicsPushedInfo_t **)((int)aiStack_c0 + iVar4 + 4) = pPVar15;
      *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c8a8;
      CBaseEntity::SetAbsOrigin
                (*(CBaseEntity **)((int)aiStack_c0 + iVar4 + 4),
                 *(Vector **)((int)aiStack_c0 + iVar4 + 8));
      *(char **)((int)aiStack_c0 + iVar4 + 8) = "Ignoring player blocking train!\n";
      *(undefined4 *)((int)aiStack_c0 + iVar4 + 4) = 1;
      *(undefined4 *)((int)aiStack_c0 + iVar4) = 0x78c8bc;
      DevMsg();
      pPVar12 = local_80;
      goto LAB_0078c3fa;
    }
  }
  pPVar12 = (PhysicsPushedInfo_t *)0x1;
LAB_0078c3fa:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    *(undefined **)((int)aiStack_c0 + iVar4) = &UNK_0078cb4d;
    __stack_chk_fail();
  }
  return pPVar12;
}

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)