L L4D2node

CPhysLength::CreateConstraint

0x00773460 · 1369 bytes · __thiscall

_ZN11CPhysLength16CreateConstraintEP23IPhysicsConstraintGroupRK20hl_constraint_info_t

Decompiled

undefined (3 params)

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

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

{
  float *pfVar1;
  float *pfVar2;
  int *piVar3;
  int *piVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  uint uVar8;
  int in_GS_OFFSET;
  float fVar9;
  float fVar10;
  float fVar11;
  float local_11c [6];
  undefined4 local_104;
  float local_100;
  float local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  uint local_f0;
  float local_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  float local_dc;
  float local_d8;
  float local_d4;
  float local_d0;
  undefined4 local_cc;
  float local_c8;
  float local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  uint local_b8;
  float local_b4;
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  float local_a0;
  float local_9c;
  float local_98;
  char local_94 [116];
  int local_20;
  
  local_f0 = CONCAT31(local_f0._1_3_,1);
  local_100 = 0.0;
  local_fc = 0.0;
  local_104 = 0x3f800000;
  local_f8 = 0x3f800000;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_f4 = 0x3f800000;
  local_ec = 0.0;
  local_e8 = 0.0;
  local_e4 = 0.0;
  local_e0 = 0.0;
  local_dc = 0.0;
  local_d8 = 0.0;
  local_d4 = 1.0;
  local_d0 = 0.0;
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  uVar5 = (uint)(byte)param_2[0x2c];
  local_11c[0] = *(float *)(this + 0x2e0);
  local_11c[1] = (float)*(undefined4 *)(this + 0x2e4);
  uVar8 = uVar5 ^ 1;
  pfVar1 = local_11c + uVar5 * 3;
  piVar3 = *(int **)(param_2 + 0x1c);
  pfVar2 = local_11c + uVar8 * 3;
  local_11c[2] = (float)*(undefined4 *)(this + 0x2e8);
  piVar4 = *(int **)(param_2 + 0x18);
  local_11c[3] = (float)*(undefined4 *)(this + 0x494);
  local_11c[4] = (float)*(undefined4 *)(this + 0x498);
  local_11c[5] = (float)*(undefined4 *)(this + 0x49c);
  if (piVar4 == (int *)0x0) {
    local_ec = *pfVar1;
    local_e8 = local_11c[uVar5 * 3 + 1];
    local_e4 = local_11c[uVar5 * 3 + 2];
  }
  else {
    (**(code **)(*piVar4 + 0xe8))(piVar4,&local_ec,pfVar1);
  }
  if (piVar3 == (int *)0x0) {
    fVar10 = *pfVar2;
    fVar9 = local_11c[uVar8 * 3 + 1];
    fVar11 = local_11c[uVar8 * 3 + 2];
    local_e0 = fVar10;
    local_dc = fVar9;
    local_d8 = fVar11;
  }
  else {
    (**(code **)(*piVar3 + 0xe8))(piVar3,&local_e0,pfVar2);
    fVar10 = *pfVar2;
    fVar9 = local_11c[uVar8 * 3 + 1];
    fVar11 = local_11c[uVar8 * 3 + 2];
  }
  local_d0 = *(float *)(this + 0x4a4);
  local_d4 = SQRT((local_11c[uVar5 * 3 + 2] - fVar11) * (local_11c[uVar5 * 3 + 2] - fVar11) +
                  (*pfVar1 - fVar10) * (*pfVar1 - fVar10) +
                  (local_11c[uVar5 * 3 + 1] - fVar9) * (local_11c[uVar5 * 3 + 1] - fVar9)) +
             *(float *)(this + 0x4a0);
  *(float *)(this + 0x4a8) = local_d4;
  if ((*(uint *)(this + 0x148) & 2) != 0) {
    local_d0 = local_d4;
  }
  *(float *)(this + 0x488) = local_e0;
  *(float *)(this + 0x48c) = local_dc;
  *(float *)(this + 0x47c) = local_ec;
  *(float *)(this + 0x490) = local_d8;
  *(float *)(this + 0x480) = local_e8;
  local_f0 = (CONCAT31(local_f0._1_3_,(char)(*(uint *)(this + 0x148) >> 2)) ^ 1) & 0xffffff01;
  *(float *)(this + 0x484) = local_e4;
  local_104 = 0x3f800000;
  piVar3 = *(int **)(param_2 + 0x18);
  local_100 = *(float *)(this + 0x454) * 0.45454544;
  local_fc = *(float *)(this + 0x458) * 0.45454544;
  local_f8 = *(undefined4 *)(param_2 + 0x24);
  local_f4 = *(undefined4 *)(param_2 + 0x28);
  if (piVar3 == (int *)0x0) {
    piVar3 = *(int **)(param_2 + 0x1c);
    if (piVar3 != (int *)0x0) {
      iVar7 = (**(code **)(*piVar3 + 0x15c))(piVar3);
LAB_007738f0:
      if (iVar7 != 0) {
        iVar6 = 0;
        goto LAB_0077378b;
      }
    }
LAB_00773990:
    (**(code **)(*physenv + 0x58))
              (physenv,*(undefined4 *)(param_2 + 0x18),*(undefined4 *)(param_2 + 0x1c),param_1,
               &local_104);
  }
  else {
    iVar6 = (**(code **)(*piVar3 + 0x15c))(piVar3);
    piVar3 = *(int **)(param_2 + 0x1c);
    if (piVar3 == (int *)0x0) {
      iVar7 = 0;
      if (iVar6 == 0) goto LAB_00773990;
    }
    else {
      iVar7 = (**(code **)(*piVar3 + 0x15c))(piVar3);
      if (iVar6 == 0) goto LAB_007738f0;
    }
LAB_0077378b:
    local_b4 = local_ec;
    local_cc = local_104;
    local_b0 = local_e8;
    local_ac = local_e4;
    local_c8 = local_100;
    local_a8 = local_e0;
    local_a4 = local_dc;
    local_c4 = local_fc;
    local_a0 = local_d8;
    local_9c = local_d4;
    local_c0 = local_f8;
    local_98 = local_d0;
    local_bc = local_f4;
    local_b8 = local_f0;
    V_BinToString(local_94,&local_cc,0x38);
    DebugDumpEntity("length_constraint\t%p\t%p\t%s",iVar6,iVar7,local_94);
    (**(code **)(*g_pPhys2World + 0x94))(g_pPhys2World,iVar6,iVar7,param_1,&local_104,0);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)