PhysCollisionScreenShake
0x0077c8f0 · 285 bytes · __cdecl
_Z24PhysCollisionScreenShakeP21gamevcollisionevent_ti
Decompiled
undefined (2 params)
/* PhysCollisionScreenShake(gamevcollisionevent_t*, int) */
void PhysCollisionScreenShake(gamevcollisionevent_t *param_1,int param_2)
{
int *piVar1;
char cVar2;
uint uVar3;
longdouble lVar4;
float fVar5;
undefined1 local_28 [24];
piVar1 = *(int **)(param_1 + param_2 * 4);
lVar4 = (longdouble)(**(code **)(*piVar1 + 0x78))(piVar1);
fVar5 = (float)lVar4;
if (500.0 <= fVar5) {
cVar2 = (**(code **)(**(int **)(param_1 + (uint)(param_2 == 0) * 4) + 8))
(*(int **)(param_1 + (uint)(param_2 == 0) * 4));
if (cVar2 != '\0') {
piVar1 = *(int **)(param_1 + param_2 * 4);
uVar3 = (**(code **)(*piVar1 + 0x50))(piVar1);
if ((uVar3 & 0x40) == 0) {
if (fVar5 <= 500.0) {
fVar5 = 500.0;
}
if (2000.0 <= fVar5) {
fVar5 = 2000.0;
}
if ((30.0 < *(float *)(param_1 + 0x18)) && (0.25 < *(float *)(param_1 + 0x14))) {
(**(code **)(**(int **)(param_1 + 0x1c) + 4))(*(int **)(param_1 + 0x1c),local_28);
fVar5 = *(float *)(param_1 + 0x18) * *(float *)(collision_shake_amp._28_4_ + 0x2c) *
6.666667e-05 * fVar5;
UTIL_ScreenShake(local_28,fVar5,*(undefined4 *)(collision_shake_freq._28_4_ + 0x2c),
*(undefined4 *)(collision_shake_time._28_4_ + 0x2c),fVar5 * 60.0,0,0,0);
return;
}
}
}
}
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.