L L4D2node

CFourWheelVehiclePhysics::VPhysicsUpdate

0x006ae440 · 723 bytes · __thiscall

_ZN24CFourWheelVehiclePhysics14VPhysicsUpdateEP14IPhysicsObject

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CFourWheelVehiclePhysics::VPhysicsUpdate(IPhysicsObject*) */

undefined4 __thiscall
CFourWheelVehiclePhysics::VPhysicsUpdate(CFourWheelVehiclePhysics *this,IPhysicsObject *param_1)

{
  float fVar1;
  float fVar2;
  uint uVar3;
  IPhysicsObject *pIVar4;
  int iVar5;
  CStudioHdr *pCVar6;
  int iVar7;
  undefined *puVar8;
  CStudioHdr *pCVar9;
  int iVar10;
  CBaseEntity *this_00;
  CBaseAnimating *pCVar11;
  int local_34;
  float local_28 [2];
  float local_20;
  
  uVar3 = *(uint *)(this + 4);
  pIVar4 = _DAT_00000238;
  if (((uVar3 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar8 + 8) == uVar3 >> 0xc)) {
    pIVar4 = *(IPhysicsObject **)(*(int *)(puVar8 + 4) + 0x238);
  }
  if (pIVar4 == param_1) {
    return 1;
  }
  if (*(int *)(this + 0x60) < 1) {
    return 0;
  }
  iVar10 = 0;
  if (*(IPhysicsObject **)(this + 0x50) == param_1) {
    local_34 = 4;
    iVar10 = 0;
  }
  else {
    do {
      local_34 = iVar10;
      iVar10 = local_34 + 1;
      if (iVar10 == *(int *)(this + 0x60)) {
        return 0;
      }
    } while (*(IPhysicsObject **)(this + iVar10 * 4 + 0x50) != param_1);
    local_34 = local_34 + 5;
  }
  this_00 = (CBaseEntity *)0x0;
  (**(code **)(*(int *)param_1 + 0xc4))
            (param_1,this + iVar10 * 0xc + 100,this + iVar10 * 0xc + 0x94);
  uVar3 = *(uint *)(this + 4);
  if (((uVar3 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar8 + 8) == uVar3 >> 0xc)) {
    this_00 = *(CBaseEntity **)(puVar8 + 4);
  }
  if (((byte)this_00[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(this_00);
  }
  VectorITransform((float *)(this + iVar10 * 0xc + 100),(matrix3x4_t *)(this_00 + 0x28c),local_28);
  fVar1 = *(float *)(this + iVar10 * 4 + 0xc4);
  iVar5 = *(int *)(this + iVar10 * 4 + 0xe4);
  fVar2 = *(float *)(this + iVar10 * 4 + 0xd4);
  uVar3 = *(uint *)(this + 4);
  if (((uVar3 == 0xffffffff) ||
      (puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar8 + 8) != uVar3 >> 0xc)) {
    pCVar11 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar11 = *(CBaseAnimating **)(puVar8 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar11 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar7 = CBaseEntity::GetModel((CBaseEntity *)pCVar11);
    if (iVar7 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar11 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar11);
      pCVar6 = *(CStudioHdr **)(pCVar11 + 0x13e0);
    }
    pCVar9 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_006ae5a6;
  }
  else {
LAB_006ae5a6:
    pCVar9 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar9 = pCVar6;
    }
  }
  CBaseAnimating::SetPoseParameter(pCVar11,pCVar9,iVar5,(fVar1 - local_20) / fVar2);
  fVar1 = *(float *)(this + iVar10 * 0xc + 0x9c);
  iVar10 = *(int *)(this + local_34 * 4 + 0xe4);
  uVar3 = *(uint *)(this + 4);
  if (((uVar3 == 0xffffffff) ||
      (puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar8 + 8) != uVar3 >> 0xc)) {
    pCVar11 = (CBaseAnimating *)0x0;
  }
  else {
    pCVar11 = *(CBaseAnimating **)(puVar8 + 4);
  }
  pCVar6 = *(CStudioHdr **)(pCVar11 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar5 = CBaseEntity::GetModel((CBaseEntity *)pCVar11);
    if (iVar5 == 0) {
      pCVar6 = *(CStudioHdr **)(pCVar11 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(pCVar11);
      pCVar6 = *(CStudioHdr **)(pCVar11 + 0x13e0);
    }
    pCVar9 = (CStudioHdr *)0x0;
    if (pCVar6 == (CStudioHdr *)0x0) goto LAB_006ae626;
  }
  pCVar9 = (CStudioHdr *)0x0;
  if (*(int *)pCVar6 != 0) {
    pCVar9 = pCVar6;
  }
LAB_006ae626:
  CBaseAnimating::SetPoseParameter(pCVar11,pCVar9,iVar10,-fVar1);
  return 0;
}

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)