L L4D2node

CPhysBox::CreateVPhysics

0x0079c7a0 · 716 bytes · __thiscall

_ZN8CPhysBox14CreateVPhysicsEv

Decompiled

undefined (1 param)

/* CPhysBox::CreateVPhysics() */

undefined4 __thiscall CPhysBox::CreateVPhysics(CPhysBox *this)

{
  code *pcVar1;
  ushort uVar2;
  int iVar3;
  undefined4 uVar4;
  vcollide_t *pvVar5;
  undefined4 uVar6;
  int *piVar7;
  uint uVar8;
  int in_GS_OFFSET;
  float fVar9;
  float fVar10;
  float local_684;
  float local_680;
  float local_67c;
  float local_678;
  float local_674;
  float local_670;
  float local_66c [3];
  solid_t local_660 [1560];
  float local_48;
  float local_3c;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = (**(code **)(*(int *)this + 0x1c))(this);
  PhysModelParseSolid(local_660,(CBaseEntity *)this,iVar3);
  if (0.0 < *(float *)(this + 0x500)) {
    local_48 = *(float *)(this + 0x500) * local_48;
  }
  pcVar1 = *(code **)(*modelinfo + 0x18);
  uVar4 = (**(code **)(*(int *)this + 0x1c))(this);
  pvVar5 = (vcollide_t *)(*pcVar1)(modelinfo,uVar4);
  PhysGetMassCenterOverride((CBaseEntity *)this,pvVar5,local_660);
  PhysSolidOverride(local_660,*(undefined4 *)(this + 0x504));
  if (local_3c < 1.0) {
    if (*(undefined4 **)(pvVar5 + 4) != (undefined4 *)0x0) {
      (**(code **)(*physcollision + 0x60))
                (physcollision,&local_684,&local_678,**(undefined4 **)(pvVar5 + 4),&vec3_origin,
                 &vec3_angle);
      local_66c[0] = local_678 - local_684;
      local_66c[1] = local_674 - local_680;
      local_66c[2] = local_670 - local_67c;
      fVar9 = local_66c[1];
      if (local_66c[0] >= local_66c[1]) {
        fVar9 = local_66c[0];
      }
      iVar3 = 8;
      fVar10 = local_66c[2];
      if (local_66c[2] <= fVar9) {
        iVar3 = (uint)(local_66c[0] < local_66c[1]) * 4;
        fVar10 = fVar9;
      }
      *(undefined4 *)((int)local_66c + iVar3) = 0;
      fVar9 = SQRT(local_66c[0] * local_66c[0] + local_66c[1] * local_66c[1] +
                   local_66c[2] * local_66c[2]);
      if ((fVar9 <= 0.0) || (fVar10 / fVar9 <= 9.0)) goto LAB_0079c848;
    }
    local_3c = 1.0;
  }
LAB_0079c848:
  uVar4 = (**(code **)(*(int *)(this + 0x194) + 0x30))(this + 0x194);
  uVar6 = (**(code **)(*(int *)(this + 0x194) + 0x2c))(this + 0x194);
  piVar7 = (int *)CBaseEntity::VPhysicsInitNormal((CBaseEntity *)this,uVar6,uVar4,1,local_660);
  if (piVar7 == (int *)0x0) {
    uVar4 = 0;
  }
  else {
    if (*(int *)(this + 0x4fc) == 1) {
      uVar2 = (**(code **)(*piVar7 + 0x50))(piVar7);
      (**(code **)(*piVar7 + 0x4c))(piVar7,uVar2 | 1);
    }
    uVar8 = *(uint *)(this + 0x148);
    if ((uVar8 & 0x100000) == 0) {
      (**(code **)(*piVar7 + 100))(piVar7);
      uVar8 = *(uint *)(this + 0x148);
    }
    if ((((uVar8 & 0x8000) != 0) || (0 < *(int *)(this + 0x508))) ||
       (0.0 < *(float *)(this + 0x50c))) {
      (**(code **)(*piVar7 + 0x40))(piVar7,0);
    }
    uVar4 = 1;
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar4;
}

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)