CGrabController::Simulate
0x004eba90 · 593 bytes · __thiscall
_ZN15CGrabController8SimulateEP24IPhysicsMotionControllerP14IPhysicsObjectfR6VectorS5_
Decompiled
undefined (6 params)
/* CGrabController::Simulate(IPhysicsMotionController*, IPhysicsObject*, float, Vector&, Vector&) */
undefined4 __thiscall
CGrabController::Simulate
(CGrabController *this,IPhysicsMotionController *param_1,IPhysicsObject *param_2,
float param_3,Vector *param_4,Vector *param_5)
{
float fVar1;
char cVar2;
int *piVar3;
int *piVar4;
longdouble lVar5;
Vector local_64 [12];
Vector local_58 [12];
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
float local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
local_4c = *(undefined4 *)(this + 0x1c);
fVar1 = *(float *)(this + 100);
local_48 = *(undefined4 *)(this + 0x20);
local_44 = *(undefined4 *)(this + 0x24);
local_40 = *(undefined4 *)(this + 0x28);
local_3c = *(undefined4 *)(this + 0x2c);
local_38 = *(undefined4 *)(this + 0x30);
local_34 = *(float *)(this + 0x34);
local_30 = *(undefined4 *)(this + 0x38);
local_2c = *(undefined4 *)(this + 0x3c);
local_28 = *(undefined4 *)(this + 0x40);
local_24 = *(undefined4 *)(this + 0x44);
local_20 = *(undefined4 *)(this + 0x48);
piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x144))(param_2);
cVar2 = (**(code **)(*piVar3 + 8))(piVar3);
do {
if (cVar2 == '\0') {
(**(code **)(*(int *)param_2 + 0x148))(param_2,piVar3);
lVar5 = (longdouble)Approach(1.0,*(float *)(this + 0x58),param_3 + param_3);
local_34 = (float)lVar5;
*(float *)(this + 0x58) = local_34;
LAB_004ebb78:
local_34 = local_34 * local_34 * *(float *)(this + 0x34) * local_34;
lVar5 = (longdouble)
(**(code **)(*(int *)param_2 + 0x128))
(param_2,&local_4c,*(undefined4 *)(this + 0x4c),param_3);
*(float *)(this + 0x4c) = (float)lVar5;
(**(code **)(*(int *)param_2 + 0xd4))(param_2,local_64,local_58);
PhysComputeSlideDirection(param_2,local_64,local_58,local_64,local_58,*(float *)(this + 100));
(**(code **)(*(int *)param_2 + 0xd0))(param_2,local_64,0);
*(undefined4 *)param_4 = 0;
*(undefined4 *)(param_4 + 4) = 0;
*(undefined4 *)(param_4 + 8) = 0;
*(undefined4 *)param_5 = 0;
*(undefined4 *)(param_5 + 4) = 0;
*(undefined4 *)(param_5 + 8) = 0;
*(float *)(this + 0x50) = *(float *)(this + 0x50) + param_3;
return 1;
}
piVar4 = (int *)(**(code **)(*piVar3 + 0xc))(piVar3,1);
cVar2 = (**(code **)(*piVar4 + 0x2c))(piVar4);
if ((cVar2 == '\0') ||
(lVar5 = (longdouble)(**(code **)(*piVar4 + 0x78))(piVar4), fVar1 < (float)lVar5)) {
(**(code **)(*(int *)param_2 + 0x148))(param_2,piVar3);
lVar5 = (longdouble)Approach(0.1,*(float *)(this + 0x58),param_3 + param_3);
local_34 = (float)lVar5;
*(float *)(this + 0x58) = local_34;
goto LAB_004ebb78;
}
(**(code **)(*piVar3 + 0x34))(piVar3);
cVar2 = (**(code **)(*piVar3 + 8))(piVar3);
} while( true );
}
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.