L L4D2node

CFourWheelVehiclePhysics::CalcWheelData

0x006abc70 · 5393 bytes · __thiscall

_ZN24CFourWheelVehiclePhysics13CalcWheelDataER15vehicleparams_t

Decompiled

undefined (2 params)

/* CFourWheelVehiclePhysics::CalcWheelData(vehicleparams_t&) */

void __thiscall
CFourWheelVehiclePhysics::CalcWheelData(CFourWheelVehiclePhysics *this,vehicleparams_t *param_1)

{
  uint uVar1;
  char *pcVar2;
  code *pcVar3;
  char cVar4;
  undefined1 *puVar5;
  CStudioHdr *pCVar6;
  int iVar7;
  int *piVar8;
  undefined4 uVar9;
  undefined *puVar10;
  int *piVar11;
  CStudioHdr *pCVar12;
  int *piVar13;
  CBaseAnimating *pCVar14;
  int iVar15;
  int iVar16;
  CBaseEntity *pCVar17;
  CBaseEntity *pCVar18;
  float fVar19;
  float fVar20;
  float fVar21;
  int aiStack_84 [2];
  undefined1 *local_60 [4];
  float local_50;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  QAngle local_38 [12];
  char *local_2c [7];
  
  local_2c[0] = "wheel_fl";
  local_2c[1] = "wheel_fr";
  local_2c[2] = "wheel_rl";
  local_2c[3] = "wheel_rr";
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xe4);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar16 = CBaseEntity::GetModel((CBaseEntity *)pCVar14);
    if (iVar16 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar14);
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006abcdc;
  }
  else {
LAB_006abcdc:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar12 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar14,pCVar12,iVar15,0.0);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xe8);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar16 = CBaseEntity::GetModel((CBaseEntity *)pCVar14);
    if (iVar16 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar14);
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006abd43;
  }
  else {
LAB_006abd43:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar12 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar14,pCVar12,iVar15,0.0);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xec);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar16 = CBaseEntity::GetModel((CBaseEntity *)pCVar14);
    if (iVar16 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar14);
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006abdaa;
  }
  else {
LAB_006abdaa:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar12 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar14,pCVar12,iVar15,0.0);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xf0);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar16 = CBaseEntity::GetModel((CBaseEntity *)pCVar14);
    if (iVar16 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar14);
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006abe11;
  }
  else {
LAB_006abe11:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar12 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar14,pCVar12,iVar15,0.0);
  uVar1 = *(uint *)(this + 4);
  pCVar14 = (CBaseAnimating *)0x0;
  if (((uVar1 != 0xffffffff) &&
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  CBaseAnimating::InvalidateBoneCache(pCVar14);
  uVar1 = *(uint *)(this + 4);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  cVar4 = CBaseAnimating::GetAttachment(pCVar14,"wheel_fl",(Vector *)&local_50,local_38);
  if (cVar4 != '\0') {
    uVar1 = *(uint *)(this + 4);
    if (((uVar1 == 0xffffffff) ||
        (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
      pCVar14 = (CBaseAnimating *)0x0;
    }
    else {
      pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
    }
    cVar4 = CBaseAnimating::GetAttachment(pCVar14,"wheel_fr",(Vector *)&local_44,local_38);
    if (cVar4 != '\0') {
      uVar1 = *(uint *)(this + 4);
      pCVar17 = (CBaseEntity *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        pCVar17 = *(CBaseEntity **)(puVar10 + 4);
      }
      if (((byte)pCVar17[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar17);
      }
      pCVar18 = (CBaseEntity *)0x0;
      VectorITransform(&local_50,(matrix3x4_t *)(pCVar17 + 0x28c),&local_50);
      uVar1 = *(uint *)(this + 4);
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        pCVar18 = *(CBaseEntity **)(puVar10 + 4);
      }
      if (((byte)pCVar18[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar18);
      }
      VectorITransform(&local_44,(matrix3x4_t *)(pCVar18 + 0x28c),&local_44);
      fVar19 = (local_3c + local_48) * 0.5;
      fVar21 = (local_50 + local_44) * 0.5;
      fVar20 = (local_4c + local_40) * 0.5;
      *(float *)(param_1 + 0x38) = fVar19;
      *(float *)(param_1 + 0x30) = fVar21;
      *(float *)(param_1 + 0x34) = fVar20;
      *(float *)(param_1 + 0x44) = local_3c - fVar19;
      *(float *)(param_1 + 0x3c) = local_44 - fVar21;
      *(float *)(param_1 + 0x40) = local_40 - fVar20;
      *(float *)(this + 0xc4) = local_48;
      *(float *)(this + 200) = local_3c;
    }
  }
  uVar1 = *(uint *)(this + 4);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  cVar4 = CBaseAnimating::GetAttachment(pCVar14,"wheel_rl",(Vector *)&local_50,local_38);
  if (cVar4 != '\0') {
    uVar1 = *(uint *)(this + 4);
    if (((uVar1 == 0xffffffff) ||
        (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
      pCVar14 = (CBaseAnimating *)0x0;
    }
    else {
      pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
    }
    cVar4 = CBaseAnimating::GetAttachment(pCVar14,"wheel_rr",(Vector *)&local_44,local_38);
    if (cVar4 != '\0') {
      uVar1 = *(uint *)(this + 4);
      pCVar17 = (CBaseEntity *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        pCVar17 = *(CBaseEntity **)(puVar10 + 4);
      }
      if (((byte)pCVar17[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar17);
      }
      pCVar18 = (CBaseEntity *)0x0;
      VectorITransform(&local_50,(matrix3x4_t *)(pCVar17 + 0x28c),&local_50);
      uVar1 = *(uint *)(this + 4);
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        pCVar18 = *(CBaseEntity **)(puVar10 + 4);
      }
      if (((byte)pCVar18[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar18);
      }
      VectorITransform(&local_44,(matrix3x4_t *)(pCVar18 + 0x28c),&local_44);
      fVar20 = (local_4c + local_40) * 0.5;
      fVar19 = (local_3c + local_48) * 0.5;
      fVar21 = (local_50 + local_44) * 0.5;
      *(float *)(param_1 + 0xa8) = fVar20;
      *(float *)(param_1 + 0xb4) = local_40 - fVar20;
      *(float *)(param_1 + 0xac) = fVar19;
      *(float *)(param_1 + 0xa4) = fVar21;
      *(float *)(param_1 + 0xb8) = local_3c - fVar19;
      *(float *)(param_1 + 0xb0) = local_44 - fVar21;
      *(float *)(this + 0xcc) = local_48;
      *(float *)(this + 0xd0) = local_3c;
    }
  }
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xe4);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar16 = CBaseEntity::GetModel((CBaseEntity *)pCVar14);
    if (iVar16 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar14);
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006abf5c;
  }
  else {
LAB_006abf5c:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar12 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar14,pCVar12,iVar15,1.0);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xe8);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar16 = CBaseEntity::GetModel((CBaseEntity *)pCVar14);
    if (iVar16 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar14);
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006abfc3;
  }
  else {
LAB_006abfc3:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar12 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar14,pCVar12,iVar15,1.0);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xec);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar16 = CBaseEntity::GetModel((CBaseEntity *)pCVar14);
    if (iVar16 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar14);
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006ac02a;
  }
  else {
LAB_006ac02a:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar12 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar14,pCVar12,iVar15,1.0);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xf0);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar16 = CBaseEntity::GetModel((CBaseEntity *)pCVar14);
    if (iVar16 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar14);
      pCVar6 = *(CStudioHdr **)(pCVar14 + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006ac091;
  }
  else {
LAB_006ac091:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar12 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar14,pCVar12,iVar15,1.0);
  uVar1 = *(uint *)(this + 4);
  pCVar14 = (CBaseAnimating *)0x0;
  if (((uVar1 != 0xffffffff) &&
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  CBaseAnimating::InvalidateBoneCache(pCVar14);
  uVar1 = *(uint *)(this + 4);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  cVar4 = CBaseAnimating::GetAttachment(pCVar14,"wheel_fl",(Vector *)&local_50,local_38);
  if (cVar4 != '\0') {
    uVar1 = *(uint *)(this + 4);
    if (((uVar1 == 0xffffffff) ||
        (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
      pCVar14 = (CBaseAnimating *)0x0;
    }
    else {
      pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
    }
    cVar4 = CBaseAnimating::GetAttachment(pCVar14,"wheel_fr",(Vector *)&local_44,local_38);
    if (cVar4 != '\0') {
      uVar1 = *(uint *)(this + 4);
      pCVar17 = (CBaseEntity *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        pCVar17 = *(CBaseEntity **)(puVar10 + 4);
      }
      if (((byte)pCVar17[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar17);
      }
      pCVar18 = (CBaseEntity *)0x0;
      VectorITransform(&local_50,(matrix3x4_t *)(pCVar17 + 0x28c),&local_50);
      uVar1 = *(uint *)(this + 4);
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        pCVar18 = *(CBaseEntity **)(puVar10 + 4);
      }
      if (((byte)pCVar18[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar18);
      }
      VectorITransform(&local_44,(matrix3x4_t *)(pCVar18 + 0x28c),&local_44);
      *(float *)(this + 0xd4) = *(float *)(this + 0xc4) - local_48;
      *(float *)(this + 0xd8) = *(float *)(this + 200) - local_3c;
      *(float *)(param_1 + 0x84) = *(float *)(this + 0xc4) - local_48;
    }
  }
  uVar1 = *(uint *)(this + 4);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    pCVar14 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
  }
  cVar4 = CBaseAnimating::GetAttachment(pCVar14,"wheel_rl",(Vector *)&local_50,local_38);
  if (cVar4 != '\0') {
    uVar1 = *(uint *)(this + 4);
    if (((uVar1 == 0xffffffff) ||
        (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
      pCVar14 = (CBaseAnimating *)0x0;
    }
    else {
      pCVar14 = *(CBaseAnimating **)(puVar10 + 4);
    }
    cVar4 = CBaseAnimating::GetAttachment(pCVar14,"wheel_rr",(Vector *)&local_44,local_38);
    if (cVar4 != '\0') {
      uVar1 = *(uint *)(this + 4);
      pCVar17 = (CBaseEntity *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        pCVar17 = *(CBaseEntity **)(puVar10 + 4);
      }
      if (((byte)pCVar17[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar17);
      }
      pCVar18 = (CBaseEntity *)0x0;
      VectorITransform(&local_50,(matrix3x4_t *)(pCVar17 + 0x28c),&local_50);
      uVar1 = *(uint *)(this + 4);
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        pCVar18 = *(CBaseEntity **)(puVar10 + 4);
      }
      if (((byte)pCVar18[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar18);
      }
      VectorITransform(&local_44,(matrix3x4_t *)(pCVar18 + 0x28c),&local_44);
      *(float *)(this + 0xdc) = *(float *)(this + 0xc4) - local_48;
      *(float *)(this + 0xe0) = *(float *)(this + 200) - local_3c;
      *(float *)(param_1 + 0xf8) = *(float *)(this + 0xc4) - local_48;
    }
  }
  iVar15 = 0;
  piVar8 = (int *)&stack0xffffff84;
  do {
    piVar11 = piVar8;
    if (*(float *)(this + iVar15 * 4 + 0xd4) == 0.0) {
      pcVar2 = local_2c[iVar15];
      piVar11 = (int *)0x0;
      uVar1 = *(uint *)(this + 4);
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        piVar11 = *(int **)(puVar10 + 4);
      }
      iVar16 = *piVar11;
      piVar8[1] = (int)piVar11;
      *piVar8 = (int)local_60;
      pcVar3 = *(code **)(iVar16 + 0x20);
      piVar8[-1] = 0x6ac1f2;
      (*pcVar3)();
      piVar11 = piVar8 + -1;
      piVar8[-1] = (int)"Vehicle %s has invalid wheel attachment for %s - no movement\n";
      puVar5 = local_60[0];
      if (local_60[0] == (undefined1 *)0x0) {
        puVar5 = &DAT_00d539c2;
      }
      *piVar8 = (int)puVar5;
      piVar8[1] = (int)pcVar2;
      piVar8[-2] = 0x6ac214;
      DevWarning((char *)piVar8[-1]);
      *(undefined4 *)(this + iVar15 * 4 + 0xd4) = 0x3f800000;
    }
    iVar15 = iVar15 + 1;
    piVar8 = piVar11;
  } while (iVar15 != 4);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xe4);
  if ((uVar1 == 0xffffffff) ||
     (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) {
    iVar16 = 0;
  }
  else {
    iVar16 = 0;
    if (*(uint *)(puVar10 + 8) == uVar1 >> 0xc) {
      iVar16 = *(int *)(puVar10 + 4);
    }
  }
  piVar8 = *(int **)(iVar16 + 0x13e0);
  if (piVar8 == (int *)0x0) {
    *piVar11 = iVar16;
    piVar11[-1] = 0x6ad128;
    iVar7 = CBaseEntity::GetModel((CBaseEntity *)*piVar11);
    if (iVar7 == 0) {
      piVar8 = *(int **)(iVar16 + 0x13e0);
    }
    else {
      *piVar11 = iVar16;
      piVar11[-1] = 0x6ad138;
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)*piVar11);
      piVar8 = *(int **)(iVar16 + 0x13e0);
    }
    piVar13 = (int *)0x0;
    if (piVar8 != (int *)0x0) goto LAB_006ac277;
  }
  else {
LAB_006ac277:
    piVar13 = (int *)0x0;
    if (*piVar8 != 0) {
      piVar13 = piVar8;
    }
  }
  piVar11[2] = iVar15;
  piVar11[3] = 0;
  piVar11[1] = (int)piVar13;
  *piVar11 = iVar16;
  piVar11[-1] = 0x6ac298;
  CBaseAnimating::SetPoseParameter
            ((CBaseAnimating *)*piVar11,(CStudioHdr *)piVar11[1],piVar11[2],(float)piVar11[3]);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xe8);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    iVar16 = 0;
  }
  else {
    iVar16 = *(int *)(puVar10 + 4);
  }
  piVar8 = *(int **)(iVar16 + 0x13e0);
  if (piVar8 == (int *)0x0) {
    *piVar11 = iVar16;
    piVar11[-1] = 0x6ad0f8;
    iVar7 = CBaseEntity::GetModel((CBaseEntity *)*piVar11);
    if (iVar7 == 0) {
      piVar8 = *(int **)(iVar16 + 0x13e0);
    }
    else {
      *piVar11 = iVar16;
      piVar11[-1] = 0x6ad108;
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)*piVar11);
      piVar8 = *(int **)(iVar16 + 0x13e0);
    }
    piVar13 = (int *)0x0;
    if (piVar8 != (int *)0x0) goto LAB_006ac2de;
  }
  else {
LAB_006ac2de:
    piVar13 = (int *)0x0;
    if (*piVar8 != 0) {
      piVar13 = piVar8;
    }
  }
  piVar11[2] = iVar15;
  piVar11[3] = 0;
  piVar11[1] = (int)piVar13;
  *piVar11 = iVar16;
  piVar11[-1] = 0x6ac2ff;
  CBaseAnimating::SetPoseParameter
            ((CBaseAnimating *)*piVar11,(CStudioHdr *)piVar11[1],piVar11[2],(float)piVar11[3]);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xec);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    iVar16 = 0;
  }
  else {
    iVar16 = *(int *)(puVar10 + 4);
  }
  piVar8 = *(int **)(iVar16 + 0x13e0);
  if (piVar8 == (int *)0x0) {
    *piVar11 = iVar16;
    piVar11[-1] = 0x6ad188;
    iVar7 = CBaseEntity::GetModel((CBaseEntity *)*piVar11);
    if (iVar7 == 0) {
      piVar8 = *(int **)(iVar16 + 0x13e0);
    }
    else {
      *piVar11 = iVar16;
      piVar11[-1] = 0x6ad198;
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)*piVar11);
      piVar8 = *(int **)(iVar16 + 0x13e0);
    }
    piVar13 = (int *)0x0;
    if (piVar8 != (int *)0x0) goto LAB_006ac345;
  }
  else {
LAB_006ac345:
    piVar13 = (int *)0x0;
    if (*piVar8 != 0) {
      piVar13 = piVar8;
    }
  }
  piVar11[2] = iVar15;
  piVar11[3] = 0;
  piVar11[1] = (int)piVar13;
  *piVar11 = iVar16;
  piVar11[-1] = 0x6ac366;
  CBaseAnimating::SetPoseParameter
            ((CBaseAnimating *)*piVar11,(CStudioHdr *)piVar11[1],piVar11[2],(float)piVar11[3]);
  uVar1 = *(uint *)(this + 4);
  iVar15 = *(int *)(this + 0xf0);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    iVar16 = 0;
  }
  else {
    iVar16 = *(int *)(puVar10 + 4);
  }
  piVar8 = *(int **)(iVar16 + 0x13e0);
  if (piVar8 == (int *)0x0) {
    *piVar11 = iVar16;
    piVar11[-1] = 0x6ad1b8;
    iVar7 = CBaseEntity::GetModel((CBaseEntity *)*piVar11);
    if (iVar7 == 0) {
      piVar8 = *(int **)(iVar16 + 0x13e0);
    }
    else {
      *piVar11 = iVar16;
      piVar11[-1] = 0x6ad1c8;
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)*piVar11);
      piVar8 = *(int **)(iVar16 + 0x13e0);
    }
    piVar13 = (int *)0x0;
    if (piVar8 == (int *)0x0) goto LAB_006ac3b5;
  }
  piVar13 = (int *)0x0;
  if (*piVar8 != 0) {
    piVar13 = piVar8;
  }
LAB_006ac3b5:
  *piVar11 = iVar16;
  piVar11[3] = 0;
  piVar11[2] = iVar15;
  piVar11[1] = (int)piVar13;
  piVar11[-1] = 0x6ac3cd;
  CBaseAnimating::SetPoseParameter
            ((CBaseAnimating *)*piVar11,(CStudioHdr *)piVar11[1],piVar11[2],(float)piVar11[3]);
  uVar1 = *(uint *)(this + 4);
  uVar9 = 0;
  if (((uVar1 != 0xffffffff) &&
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
    uVar9 = *(undefined4 *)(puVar10 + 4);
  }
  *piVar11 = uVar9;
  piVar11[-1] = 0x6ac407;
  CBaseAnimating::InvalidateBoneCache((CBaseAnimating *)*piVar11);
  uVar1 = *(uint *)(this + 4);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    uVar9 = 0;
  }
  else {
    uVar9 = *(undefined4 *)(puVar10 + 4);
  }
  piVar11[1] = (int)"raytrace_fl";
  piVar11[3] = (int)local_38;
  piVar11[2] = (int)&local_50;
  *piVar11 = uVar9;
  piVar11[-1] = 0x6ac455;
  cVar4 = CBaseAnimating::GetAttachment
                    ((CBaseAnimating *)*piVar11,(char *)piVar11[1],(Vector *)piVar11[2],
                     (QAngle *)piVar11[3]);
  if (cVar4 != '\0') {
    uVar1 = *(uint *)(this + 4);
    if (((uVar1 == 0xffffffff) ||
        (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
      uVar9 = 0;
    }
    else {
      uVar9 = *(undefined4 *)(puVar10 + 4);
    }
    piVar11[1] = (int)"raytrace_fr";
    piVar11[3] = (int)local_38;
    piVar11[2] = (int)&local_44;
    *piVar11 = uVar9;
    piVar11[-1] = 0x6acc70;
    cVar4 = CBaseAnimating::GetAttachment
                      ((CBaseAnimating *)*piVar11,(char *)piVar11[1],(Vector *)piVar11[2],
                       (QAngle *)piVar11[3]);
    if (cVar4 != '\0') {
      uVar1 = *(uint *)(this + 4);
      iVar15 = 0;
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        iVar15 = *(int *)(puVar10 + 4);
      }
      if ((*(byte *)(iVar15 + 0x14d) & 8) != 0) {
        *piVar11 = iVar15;
        piVar11[-1] = 0x6acf78;
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar11);
      }
      piVar11[2] = (int)&local_50;
      piVar11[1] = iVar15 + 0x28c;
      iVar15 = 0;
      *piVar11 = (int)&local_50;
      piVar11[-1] = 0x6acccf;
      VectorITransform((float *)*piVar11,(matrix3x4_t *)piVar11[1],(float *)piVar11[2]);
      uVar1 = *(uint *)(this + 4);
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        iVar15 = *(int *)(puVar10 + 4);
      }
      if ((*(byte *)(iVar15 + 0x14d) & 8) != 0) {
        *piVar11 = iVar15;
        piVar11[-1] = 0x6acf28;
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar11);
      }
      piVar11[2] = (int)&local_44;
      piVar11[1] = iVar15 + 0x28c;
      *piVar11 = (int)&local_44;
      piVar11[-1] = 0x6acd20;
      VectorITransform((float *)*piVar11,(matrix3x4_t *)piVar11[1],(float *)piVar11[2]);
      fVar21 = (local_50 + local_44) * 0.5;
      fVar20 = (local_4c + local_40) * 0.5;
      fVar19 = (local_48 + local_3c) * 0.5;
      *(float *)(param_1 + 0x48) = fVar21;
      *(float *)(param_1 + 0x4c) = fVar20;
      *(float *)(param_1 + 0x50) = fVar19;
      *(float *)(param_1 + 0x54) = local_44 - fVar21;
      *(float *)(param_1 + 0x58) = local_40 - fVar20;
      *(float *)(param_1 + 0x5c) = local_3c - fVar19;
    }
  }
  uVar1 = *(uint *)(this + 4);
  if (((uVar1 == 0xffffffff) ||
      (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
    uVar9 = 0;
  }
  else {
    uVar9 = *(undefined4 *)(puVar10 + 4);
  }
  piVar11[1] = (int)"raytrace_rl";
  piVar11[3] = (int)local_38;
  piVar11[2] = (int)&local_50;
  *piVar11 = uVar9;
  piVar11[-1] = 0x6ac4ab;
  cVar4 = CBaseAnimating::GetAttachment
                    ((CBaseAnimating *)*piVar11,(char *)piVar11[1],(Vector *)piVar11[2],
                     (QAngle *)piVar11[3]);
  if (cVar4 != '\0') {
    uVar1 = *(uint *)(this + 4);
    if (((uVar1 == 0xffffffff) ||
        (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar10 + 8) != uVar1 >> 0xc)) {
      uVar9 = 0;
    }
    else {
      uVar9 = *(undefined4 *)(puVar10 + 4);
    }
    piVar11[1] = (int)"raytrace_rr";
    piVar11[3] = (int)local_38;
    piVar11[2] = (int)&local_44;
    *piVar11 = uVar9;
    piVar11[-1] = 0x6acae0;
    cVar4 = CBaseAnimating::GetAttachment
                      ((CBaseAnimating *)*piVar11,(char *)piVar11[1],(Vector *)piVar11[2],
                       (QAngle *)piVar11[3]);
    if (cVar4 != '\0') {
      uVar1 = *(uint *)(this + 4);
      iVar15 = 0;
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        iVar15 = *(int *)(puVar10 + 4);
      }
      if ((*(byte *)(iVar15 + 0x14d) & 8) != 0) {
        *piVar11 = iVar15;
        piVar11[-1] = 0x6acee8;
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar11);
      }
      piVar11[2] = (int)&local_50;
      piVar11[1] = iVar15 + 0x28c;
      iVar15 = 0;
      *piVar11 = (int)&local_50;
      piVar11[-1] = 0x6acb3f;
      VectorITransform((float *)*piVar11,(matrix3x4_t *)piVar11[1],(float *)piVar11[2]);
      uVar1 = *(uint *)(this + 4);
      if (((uVar1 != 0xffffffff) &&
          (puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
        iVar15 = *(int *)(puVar10 + 4);
      }
      if ((*(byte *)(iVar15 + 0x14d) & 8) != 0) {
        *piVar11 = iVar15;
        piVar11[-1] = 0x6acef8;
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar11);
      }
      piVar11[2] = (int)&local_44;
      piVar11[1] = iVar15 + 0x28c;
      *piVar11 = (int)&local_44;
      piVar11[-1] = 0x6acb90;
      VectorITransform((float *)*piVar11,(matrix3x4_t *)piVar11[1],(float *)piVar11[2]);
      fVar21 = (local_50 + local_44) * 0.5;
      fVar20 = (local_4c + local_40) * 0.5;
      fVar19 = (local_48 + local_3c) * 0.5;
      *(float *)(param_1 + 0xbc) = fVar21;
      *(float *)(param_1 + 0xc0) = fVar20;
      *(float *)(param_1 + 0xc4) = fVar19;
      *(float *)(param_1 + 200) = local_44 - fVar21;
      *(float *)(param_1 + 0xcc) = local_40 - fVar20;
      *(float *)(param_1 + 0xd0) = local_3c - fVar19;
      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)