PhysCallbackSetVelocity
0x0077d110 · 332 bytes · __cdecl
_Z23PhysCallbackSetVelocityP14IPhysicsObjectRK6Vector
Decompiled
undefined (2 params)
/* PhysCallbackSetVelocity(IPhysicsObject*, Vector const&) */
void PhysCallbackSetVelocity(IPhysicsObject *param_1,Vector *param_2)
{
undefined4 uVar1;
undefined4 uVar2;
undefined4 uVar3;
undefined4 *puVar4;
int iVar5;
char cVar6;
CFunctor2<void(*)(IPhysicsObject*,Vector_const&),IPhysicsObject*,Vector,CRefCounted1<CFunctor,CRefCountServiceBase<true,CRefMT>>>
*this;
undefined4 *puVar7;
undefined4 *puVar8;
uVar1 = *(undefined4 *)param_2;
uVar2 = *(undefined4 *)(param_2 + 4);
uVar3 = *(undefined4 *)(param_2 + 8);
this = operator_new(0x24);
*(undefined4 *)(this + 0xc) = 1;
*(undefined ***)this = &PTR_AddRef_00cb11c8;
*(undefined **)(this + 8) = &DAT_00cb11e4;
*(code **)(this + 0x10) = PostSimulation_SetVelocityEvent;
*(IPhysicsObject **)(this + 0x14) = param_1;
*(undefined4 *)(this + 0x18) = uVar1;
*(undefined4 *)(this + 0x1c) = uVar2;
*(undefined4 *)(this + 0x20) = uVar3;
if (DAT_00fec500 != '\0') {
CFunctor2<void(*)(IPhysicsObject*,Vector_const&),IPhysicsObject*,Vector,CRefCounted1<CFunctor,CRefCountServiceBase<true,CRefMT>>>
::operator()(this);
/* WARNING: Could not recover jumptable at 0x0077d198. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*(int *)this + 4))();
return;
}
do {
puVar7 = DAT_00fec4f8;
if (DAT_00fec4f8 == (undefined4 *)0x0) {
puVar7 = operator_new(8);
break;
}
cVar6 = ThreadInterlockedAssignIf64
(&DAT_00fec4f8,*DAT_00fec4f8,DAT_00fec4fc + -1,DAT_00fec4f8,DAT_00fec4fc);
} while (cVar6 == '\0');
puVar7[1] = this;
*puVar7 = &g_PostSimulationQueue;
while( true ) {
iVar5 = DAT_00fec4ec;
puVar4 = DAT_00fec4e8;
LOCK();
puVar8 = (undefined4 *)*DAT_00fec4e8;
if (puVar8 == &g_PostSimulationQueue) {
*DAT_00fec4e8 = puVar7;
puVar8 = &g_PostSimulationQueue;
}
UNLOCK();
if (puVar8 == &g_PostSimulationQueue) break;
ThreadInterlockedAssignIf64(&DAT_00fec4e8,*puVar4,iVar5 + 1,puVar4,iVar5);
}
ThreadInterlockedAssignIf64(&DAT_00fec4e8,puVar7,iVar5 + 1,puVar4,iVar5);
LOCK();
DAT_00fec4f0 = DAT_00fec4f0 + 1;
UNLOCK();
return;
}
SourceMod gamedata
paste intoaddons/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.
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.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.