PhysCallbackImpulse
0x0077cf80 · 378 bytes · __cdecl
_Z19PhysCallbackImpulseP14IPhysicsObjectRK6VectorS3_
Decompiled
undefined (3 params)
/* PhysCallbackImpulse(IPhysicsObject*, Vector const&, Vector const&) */
void PhysCallbackImpulse(IPhysicsObject *param_1,Vector *param_2,Vector *param_3)
{
undefined4 uVar1;
undefined4 uVar2;
undefined4 uVar3;
undefined4 uVar4;
undefined4 uVar5;
undefined4 uVar6;
undefined4 *puVar7;
int iVar8;
char cVar9;
CFunctor3<void(*)(IPhysicsObject*,Vector_const&,Vector_const&),IPhysicsObject*,Vector,Vector,CRefCounted1<CFunctor,CRefCountServiceBase<true,CRefMT>>>
*this;
undefined4 *puVar10;
undefined4 *puVar11;
bool bVar12;
uVar1 = *(undefined4 *)param_2;
uVar2 = *(undefined4 *)param_3;
uVar3 = *(undefined4 *)(param_2 + 4);
uVar4 = *(undefined4 *)(param_2 + 8);
uVar5 = *(undefined4 *)(param_3 + 4);
uVar6 = *(undefined4 *)(param_3 + 8);
this = operator_new(0x30);
*(undefined4 *)(this + 0xc) = 1;
*(undefined ***)this = &PTR_AddRef_00cb1188;
*(undefined **)(this + 8) = &DAT_00cb11a4;
*(code **)(this + 0x10) = PostSimulation_ImpulseEvent;
*(undefined4 *)(this + 0x18) = uVar1;
*(undefined4 *)(this + 0x1c) = uVar3;
*(undefined4 *)(this + 0x20) = uVar4;
*(IPhysicsObject **)(this + 0x14) = param_1;
bVar12 = DAT_00fec500 != '\0';
*(undefined4 *)(this + 0x24) = uVar2;
*(undefined4 *)(this + 0x28) = uVar5;
*(undefined4 *)(this + 0x2c) = uVar6;
if (bVar12) {
CFunctor3<void(*)(IPhysicsObject*,Vector_const&,Vector_const&),IPhysicsObject*,Vector,Vector,CRefCounted1<CFunctor,CRefCountServiceBase<true,CRefMT>>>
::operator()(this);
(**(code **)(*(int *)this + 4))(this);
return;
}
do {
puVar10 = DAT_00fec4f8;
if (DAT_00fec4f8 == (undefined4 *)0x0) {
puVar10 = operator_new(8);
break;
}
cVar9 = ThreadInterlockedAssignIf64
(&DAT_00fec4f8,*DAT_00fec4f8,DAT_00fec4fc + -1,DAT_00fec4f8,DAT_00fec4fc);
} while (cVar9 == '\0');
puVar10[1] = this;
*puVar10 = &g_PostSimulationQueue;
while( true ) {
iVar8 = DAT_00fec4ec;
puVar7 = DAT_00fec4e8;
LOCK();
puVar11 = (undefined4 *)*DAT_00fec4e8;
if (puVar11 == &g_PostSimulationQueue) {
*DAT_00fec4e8 = puVar10;
puVar11 = &g_PostSimulationQueue;
}
UNLOCK();
if (puVar11 == &g_PostSimulationQueue) break;
ThreadInterlockedAssignIf64(&DAT_00fec4e8,*puVar7,iVar8 + 1,puVar7,iVar8);
}
ThreadInterlockedAssignIf64(&DAT_00fec4e8,puVar10,iVar8 + 1,puVar7,iVar8);
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.