L L4D2node

CPhysFixed::CreateConstraint

0x007739d0 · 776 bytes · __thiscall

_ZN10CPhysFixed16CreateConstraintEP23IPhysicsConstraintGroupRK20hl_constraint_info_t

Decompiled

undefined (3 params)

/* CPhysFixed::CreateConstraint(IPhysicsConstraintGroup*, hl_constraint_info_t const&) */

void __thiscall
CPhysFixed::CreateConstraint
          (CPhysFixed *this,IPhysicsConstraintGroup *param_1,hl_constraint_info_t *param_2)

{
  int *piVar1;
  ushort uVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  matrix3x4_t *pmVar6;
  undefined4 *puVar7;
  int in_GS_OFFSET;
  byte bVar8;
  matrix3x4_t *local_1b0;
  matrix3x4_t local_1a4 [48];
  matrix3x4_t local_174 [48];
  matrix3x4_t local_144 [48];
  undefined4 local_114;
  float local_110;
  float local_10c;
  undefined4 local_108;
  undefined4 local_104;
  byte local_100;
  undefined4 local_fc [18];
  char local_b4 [148];
  int local_20;
  
  bVar8 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  SetIdentityMatrix(local_144);
  piVar3 = *(int **)(param_2 + 0x18);
  local_100 = 1;
  local_110 = 0.0;
  piVar1 = *(int **)(param_2 + 0x1c);
  local_10c = 0.0;
  local_114 = 0x3f800000;
  local_108 = 0x3f800000;
  local_104 = 0x3f800000;
  if (piVar3 == (int *)0x0) {
    SetIdentityMatrix(local_1a4);
  }
  else {
    (**(code **)(*piVar3 + 200))(piVar3,local_174);
    MatrixInvert(local_174,local_1a4);
  }
  local_1b0 = local_1a4;
  if (piVar1 == (int *)0x0) {
    SetIdentityMatrix(local_174);
  }
  else {
    (**(code **)(*piVar1 + 200))(piVar1,local_174);
  }
  ConcatTransforms(local_1b0,local_174,local_144);
  local_114 = 0x3f800000;
  local_110 = *(float *)(this + 0x454) * 0.45454544;
  local_10c = *(float *)(this + 0x458) * 0.45454544;
  local_100 = ((byte)(*(uint *)(this + 0x148) >> 2) ^ 1) & 1;
  piVar3 = *(int **)(param_2 + 0x18);
  local_108 = *(undefined4 *)(param_2 + 0x24);
  local_104 = *(undefined4 *)(param_2 + 0x28);
  if (piVar3 == g_PhysWorldObject) {
    piVar3 = *(int **)(param_2 + 0x1c);
    uVar2 = (**(code **)(*piVar3 + 0x50))(piVar3);
    (**(code **)(*piVar3 + 0x4c))(piVar3,uVar2 | 2);
    piVar3 = *(int **)(param_2 + 0x18);
  }
  if (piVar3 == (int *)0x0) {
    piVar3 = *(int **)(param_2 + 0x1c);
    if (piVar3 != (int *)0x0) {
      local_1b0 = (matrix3x4_t *)(**(code **)(*piVar3 + 0x15c))(piVar3);
LAB_00773c20:
      if (local_1b0 != (matrix3x4_t *)0x0) {
        iVar4 = 0;
        goto LAB_00773b64;
      }
    }
LAB_00773cb0:
    (**(code **)(*physenv + 0x48))
              (physenv,*(undefined4 *)(param_2 + 0x18),*(undefined4 *)(param_2 + 0x1c),param_1,
               local_144);
  }
  else {
    iVar4 = (**(code **)(*piVar3 + 0x15c))(piVar3);
    piVar3 = *(int **)(param_2 + 0x1c);
    if (piVar3 == (int *)0x0) {
      if (iVar4 == 0) goto LAB_00773cb0;
      local_1b0 = (matrix3x4_t *)0x0;
    }
    else {
      local_1b0 = (matrix3x4_t *)(**(code **)(*piVar3 + 0x15c))(piVar3);
      if (iVar4 == 0) goto LAB_00773c20;
    }
LAB_00773b64:
    pmVar6 = local_144;
    puVar7 = local_fc;
    for (iVar5 = 0x12; iVar5 != 0; iVar5 = iVar5 + -1) {
      *puVar7 = *(undefined4 *)pmVar6;
      pmVar6 = pmVar6 + ((uint)bVar8 * -2 + 1) * 4;
      puVar7 = puVar7 + (uint)bVar8 * -2 + 1;
    }
    V_BinToString(local_b4,local_fc,0x48);
    DebugDumpEntity("fixed_constraint\t%p\t%p\t%s",iVar4,local_1b0,local_b4);
    (**(code **)(*g_pPhys2World + 0x90))(g_pPhys2World,iVar4,local_1b0,param_1,local_144,0);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __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)