CPhysHinge::CreateConstraint
0x007771c0 · 723 bytes · __thiscall
_ZN10CPhysHinge16CreateConstraintEP23IPhysicsConstraintGroupRK20hl_constraint_info_t
Decompiled
undefined (3 params)
/* CPhysHinge::CreateConstraint(IPhysicsConstraintGroup*, hl_constraint_info_t const&) */
undefined4 __thiscall
CPhysHinge::CreateConstraint
(CPhysHinge *this,IPhysicsConstraintGroup *param_1,hl_constraint_info_t *param_2)
{
CBaseEdict *this_00;
int *piVar1;
char cVar2;
int iVar3;
int iVar4;
undefined4 uVar5;
uint uVar6;
int local_20 [4];
if (((vec3_origin == *(float *)(this + 0x48c)) && (DAT_01053d4c == *(float *)(this + 0x490))) &&
(DAT_01053d50 == *(float *)(this + 0x494))) {
DevMsg("ERROR: Hinge with bad data!!!\n");
return 0;
}
*(undefined4 *)(this + 0x4b4) = 0x3f800000;
*(undefined4 *)(this + 0x4b8) = 0x3f800000;
*(undefined4 *)(this + 0x4a8) = 0x3f800000;
this[0x4bc] = (CPhysHinge)(((byte)(*(uint *)(this + 0x148) >> 2) ^ 1) & 1);
*(float *)(this + 0x4ac) = *(float *)(this + 0x454) * 0.45454544;
*(float *)(this + 0x4b0) = *(float *)(this + 0x458) * 0.45454544;
*(undefined4 *)(this + 0x4b4) = *(undefined4 *)(param_2 + 0x24);
uVar5 = *(undefined4 *)(param_2 + 0x28);
*(undefined4 *)(this + 0x498) = 0;
*(undefined4 *)(this + 0x49c) = 0;
*(undefined4 *)(this + 0x4b8) = uVar5;
*(undefined4 *)(this + 0x4a0) = 0;
*(float *)(this + 0x4a4) = *(float *)(this + 0x4c0) * 1000.0;
cVar2 = IsWorldHinge(this,param_2,local_20);
if (cVar2 == '\0') {
uVar6 = *(uint *)(this + 0x148) & 0xfffffff7;
if (*(uint *)(this + 0x148) != uVar6) {
if (this[0x6c] == (CPhysHinge)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar3 + 2) = 0;
}
*(uint *)(this + 0x148) = uVar6;
}
else {
this[0x70] = (CPhysHinge)((byte)this[0x70] | 1);
*(uint *)(this + 0x148) = uVar6;
}
}
}
else {
(**(code **)(**(int **)(param_2 + 0x1c) + 0x13c))(*(int **)(param_2 + 0x1c),local_20[0]);
}
piVar1 = *(int **)(param_2 + 0x18);
if (piVar1 == (int *)0x0) {
piVar1 = *(int **)(param_2 + 0x1c);
if (piVar1 != (int *)0x0) {
iVar3 = (**(code **)(*piVar1 + 0x15c))(piVar1);
LAB_007773f0:
if (iVar3 != 0) {
iVar4 = 0;
goto LAB_00777331;
}
}
LAB_00777470:
uVar5 = (**(code **)(*physenv + 0x44))
(physenv,*(undefined4 *)(param_2 + 0x18),*(undefined4 *)(param_2 + 0x1c),
param_1,this + 0x480);
}
else {
iVar4 = (**(code **)(*piVar1 + 0x15c))(piVar1);
piVar1 = *(int **)(param_2 + 0x1c);
if (piVar1 == (int *)0x0) {
iVar3 = 0;
if (iVar4 == 0) goto LAB_00777470;
}
else {
iVar3 = (**(code **)(*piVar1 + 0x15c))(piVar1);
if (iVar4 == 0) goto LAB_007773f0;
}
LAB_00777331:
DebugDumpEntity("hinge_constraint\t%p\t%p\t%f\t%f\t%f\t%f\t%f\t%f",iVar4,iVar3,
(double)*(float *)(this + 0x480),(double)*(float *)(this + 0x484),
(double)*(float *)(this + 0x488),(double)*(float *)(this + 0x48c),
(double)*(float *)(this + 0x490),(double)*(float *)(this + 0x494),iVar3);
uVar5 = (**(code **)(*g_pPhys2World + 0x78))(g_pPhys2World,iVar4,iVar3,param_1,this + 0x480,0);
}
return uVar5;
}
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.