L L4D2node

CPhysicsProp::CreateVPhysics

0x007e7ca0 · 814 bytes · __thiscall

_ZN12CPhysicsProp14CreateVPhysicsEv

Decompiled

undefined (1 param)

/* CPhysicsProp::CreateVPhysics() */

undefined4 __thiscall CPhysicsProp::CreateVPhysics(CPhysicsProp *this)

{
  code *pcVar1;
  CBaseEdict *this_00;
  char cVar2;
  int iVar3;
  vcollide_t *pvVar4;
  int *piVar5;
  uint uVar6;
  undefined4 uVar7;
  char **ppcVar8;
  int in_GS_OFFSET;
  longdouble lVar9;
  char *local_690;
  solid_t local_660 [1560];
  float local_48;
  float local_44;
  undefined1 local_24;
  int local_20;
  
  ppcVar8 = (char **)&stack0xfffff974;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_690 = (char *)0x7e7cce;
  iVar3 = (**(code **)(*(int *)this + 0x1c))();
  local_690 = (char *)0x7e7ce1;
  PhysModelParseSolid(local_660,(CBaseEntity *)this,iVar3);
  if (0.0 < *(float *)(this + 0x1640)) {
    local_48 = *(float *)(this + 0x1640) * local_48;
  }
  if ((0.0 < *(float *)(this + 0x1644)) &&
     (local_44 = *(float *)(this + 0x1644) * local_44, local_44 <= 0.5)) {
    local_44 = 0.5;
  }
  pcVar1 = *(code **)(*modelinfo + 0x18);
  local_690 = (char *)0x7e7d39;
  (**(code **)(*(int *)this + 0x1c))();
  local_690 = (char *)0x7e7d4d;
  pvVar4 = (vcollide_t *)(*pcVar1)();
  local_690 = (char *)0x7e7d5d;
  PhysGetMassCenterOverride((CBaseEntity *)this,pvVar4,local_660);
  if (((byte)this[0x14a] & 0x20) != 0) {
    local_24 = 0;
  }
  local_690 = (char *)0x7e7d7c;
  PhysSolidOverride();
  local_690 = (char *)0x7e7d9c;
  piVar5 = (int *)CBaseEntity::VPhysicsInitNormal();
  if (piVar5 == (int *)0x0) {
    local_690 = (char *)0x7e7f86;
    CCollisionProperty::SetSolid();
    local_690 = (char *)0x7e7f9e;
    CBaseEntity::SetMoveType();
    local_690 = (char *)0x7e7fb0;
    (**(code **)(*(int *)this + 0x20))();
    ppcVar8 = &local_690;
    local_690 = "ERROR!: Can\'t create physics object for %s\n";
    Warning();
    uVar7 = 0;
    goto LAB_007e7e85;
  }
  if (*(int *)(this + 0x1648) == 1) {
    local_690 = (char *)0x7e7f58;
    (**(code **)(*piVar5 + 0x50))();
    local_690 = (char *)0x7e7f6a;
    (**(code **)(*piVar5 + 0x4c))();
  }
  if (((((byte)this[0x148] & 8) != 0) || (0 < *(int *)(this + 0x1650))) ||
     (0.0 < *(float *)(this + 0x1654))) {
    local_690 = (char *)0x7e7dd0;
    (**(code **)(*piVar5 + 0x40))();
  }
  local_690 = (char *)0x7e7de3;
  cVar2 = (**(code **)(*(int *)this + 0x440))();
  if (cVar2 != '\0') {
    local_690 = (char *)0x7e7df5;
    uVar6 = (**(code **)(**(int **)(this + 0x238) + 0x50))();
    if ((uVar6 & 1) == 0) {
      local_690 = (char *)0x7e7f28;
      (**(code **)(*piVar5 + 0x50))();
      local_690 = (char *)0x7e7f3a;
      (**(code **)(*piVar5 + 0x4c))();
    }
  }
  local_690 = (char *)0x7e7e10;
  cVar2 = (**(code **)(*(int *)this + 0x440))();
  if (cVar2 != '\0') {
    local_690 = (char *)0x7e7e1c;
    (**(code **)(*piVar5 + 0x50))();
    local_690 = (char *)0x7e7e2e;
    (**(code **)(*piVar5 + 0x4c))();
  }
  if (((byte)this[0x149] & 2) == 0) {
    local_690 = (char *)0x7e7e43;
    cVar2 = (**(code **)(*piVar5 + 0x2c))();
    if (cVar2 == '\0') goto LAB_007e7e4b;
LAB_007e7ef1:
    local_690 = (char *)0x7e7ef9;
    lVar9 = (longdouble)(**(code **)(*piVar5 + 0x78))();
    if (500.0 <= (float)lVar9) goto LAB_007e7e4b;
  }
  else {
    local_690 = (char *)0x7e7ed0;
    (**(code **)(*piVar5 + 0x50))();
    local_690 = (char *)0x7e7ee1;
    (**(code **)(*piVar5 + 0x4c))();
    local_690 = (char *)0x7e7ee9;
    cVar2 = (**(code **)(*piVar5 + 0x2c))();
    if (cVar2 != '\0') goto LAB_007e7ef1;
LAB_007e7e4b:
    if (this[0x154a] != (CPhysicsProp)0x1) {
      if (this[0x6c] == (CPhysicsProp)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          local_690 = (char *)0x7e7e73;
          iVar3 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
        this[0x154a] = (CPhysicsProp)0x1;
      }
      else {
        this[0x70] = (CPhysicsProp)((byte)this[0x70] | 1);
        this[0x154a] = (CPhysicsProp)0x1;
      }
    }
  }
  uVar7 = 1;
LAB_007e7e85:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar7;
  }
                    /* WARNING: Subroutine does not return */
  *(undefined **)((int)ppcVar8 + -4) = &UNK_007e7fdf;
  __stack_chk_fail();
}

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)