CRagdollConstraint::CreateConstraint
0x007729f0 · 1086 bytes · __thiscall
_ZN18CRagdollConstraint16CreateConstraintEP23IPhysicsConstraintGroupRK20hl_constraint_info_t
Decompiled
undefined (3 params)
/* CRagdollConstraint::CreateConstraint(IPhysicsConstraintGroup*, hl_constraint_info_t const&) */
undefined4 __thiscall
CRagdollConstraint::CreateConstraint
(CRagdollConstraint *this,IPhysicsConstraintGroup *param_1,hl_constraint_info_t *param_2)
{
int iVar1;
int *piVar2;
int iVar3;
undefined4 uVar4;
int iVar5;
undefined4 *puVar6;
undefined4 *puVar7;
int in_GS_OFFSET;
bool bVar8;
byte bVar9;
matrix3x4_t local_354 [48];
matrix3x4_t local_324 [48];
undefined4 local_2f4;
undefined4 local_2f0;
undefined4 local_2ec;
undefined4 local_2e8;
undefined4 local_2e4;
undefined1 local_2e0;
matrix3x4_t local_2dc [48];
matrix3x4_t local_2ac [48];
undefined4 local_27c;
undefined4 local_278;
undefined4 local_274;
undefined4 local_270;
undefined4 local_26c;
undefined4 local_268;
undefined4 local_264;
undefined4 local_260;
undefined4 local_25c;
undefined4 local_258;
undefined4 local_254;
undefined4 local_250;
undefined4 local_24c;
undefined4 local_248;
byte local_244;
undefined1 local_243;
undefined1 local_242;
undefined4 local_240 [45];
char local_18c [364];
int local_20;
bVar9 = 0;
local_2e0 = 1;
local_2f0 = 0;
local_2ec = 0;
local_2f4 = 0x3f800000;
local_2e8 = 0x3f800000;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_243 = 1;
local_2e4 = 0x3f800000;
SetIdentityMatrix(local_2dc);
SetIdentityMatrix(local_2ac);
piVar2 = *(int **)(param_2 + 0x18);
local_244 = 0;
local_27c = 0xffffffff;
local_278 = 0xffffffff;
local_274 = 0;
local_270 = 0;
local_26c = 0;
local_268 = 0;
local_264 = 0;
local_260 = 0;
local_25c = 0;
local_258 = 0;
local_254 = 0;
local_250 = 0;
local_24c = 0;
local_248 = 0;
local_242 = 0;
if (piVar2 == (int *)0x0) {
SetIdentityMatrix(local_2dc);
}
else {
(**(code **)(*piVar2 + 200))(piVar2,local_354);
MatrixInvert(local_354,local_324);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
ConcatTransforms(local_324,(matrix3x4_t *)(this + 0x28c),local_2dc);
}
piVar2 = *(int **)(param_2 + 0x1c);
if (piVar2 == (int *)0x0) {
SetIdentityMatrix(local_2ac);
}
else {
(**(code **)(*piVar2 + 200))(piVar2,local_354);
MatrixInvert(local_354,local_324);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
ConcatTransforms(local_324,(matrix3x4_t *)(this + 0x28c),local_2ac);
}
local_26c = 0;
local_25c = 0;
local_24c = 0;
local_268 = *(undefined4 *)(this + 0x494);
local_270 = *(undefined4 *)(this + 0x480);
local_274 = *(undefined4 *)(this + 0x47c);
local_258 = *(undefined4 *)(this + 0x498);
local_244 = (byte)(*(uint *)(this + 0x148) >> 1) & 1;
local_264 = *(undefined4 *)(this + 0x484);
local_260 = *(undefined4 *)(this + 0x488);
local_254 = *(undefined4 *)(this + 0x48c);
local_250 = *(undefined4 *)(this + 0x490);
local_248 = *(undefined4 *)(this + 0x49c);
if ((*(uint *)(this + 0x148) & 4) != 0) {
local_243 = 0;
}
piVar2 = *(int **)(param_2 + 0x18);
if (piVar2 == (int *)0x0) {
piVar2 = *(int **)(param_2 + 0x1c);
bVar8 = false;
iVar1 = 0;
if (piVar2 == (int *)0x0) goto LAB_00772d4b;
LAB_00772cd2:
iVar3 = (**(code **)(*piVar2 + 0x15c))(piVar2);
if (iVar3 == 0) goto joined_r0x00772d51;
}
else {
iVar1 = (**(code **)(*piVar2 + 0x15c))(piVar2);
bVar8 = iVar1 != 0;
piVar2 = *(int **)(param_2 + 0x1c);
if (piVar2 != (int *)0x0) goto LAB_00772cd2;
LAB_00772d4b:
iVar3 = 0;
joined_r0x00772d51:
if (!bVar8) {
uVar4 = 0;
if (physenv != (int *)0x0) {
uVar4 = (**(code **)(*physenv + 0x40))
(physenv,*(undefined4 *)(param_2 + 0x18),*(undefined4 *)(param_2 + 0x1c),
param_1,&local_2f4);
}
goto LAB_00772d1f;
}
}
puVar6 = &local_2f4;
puVar7 = local_240;
for (iVar5 = 0x2c; iVar5 != 0; iVar5 = iVar5 + -1) {
*puVar7 = *puVar6;
puVar6 = puVar6 + (uint)bVar9 * -2 + 1;
puVar7 = puVar7 + (uint)bVar9 * -2 + 1;
}
*(undefined2 *)puVar7 = *(undefined2 *)puVar6;
*(undefined1 *)((int)puVar7 + 2) = *(undefined1 *)((int)puVar6 + 2);
V_BinToString(local_18c,local_240,0xb4);
DebugDumpEntity("ragdoll_constraint\t%p\t%p\t%s",iVar1,iVar3,local_18c);
uVar4 = (**(code **)(*g_pPhys2World + 0x20))(g_pPhys2World,iVar1,iVar3,&local_2f4,0);
LAB_00772d1f:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar4;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.