CRagdoll2::AddHit2
0x004a0730 · 498 bytes · __thiscall
_ZN9CRagdoll27AddHit2ERK15ragdollparams_t
Decompiled
undefined (2 params)
/* CRagdoll2::AddHit2(ragdollparams_t const&) */
void __thiscall CRagdoll2::AddHit2(CRagdoll2 *this,ragdollparams_t *param_1)
{
int *piVar1;
int iVar2;
CRagdoll2 *pCVar3;
int iVar4;
int iVar5;
longdouble lVar6;
float local_50;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
iVar4 = *(int *)(this + 8);
iVar2 = (int)*(short *)(*(int *)(param_1 + 0x28) * 0x38 + *(int *)(this + 0x8ac) + 0x54);
if (iVar4 < 1) {
local_50 = 1.0;
}
else {
pCVar3 = this + 0x20;
local_50 = 0.0;
iVar5 = 0;
do {
piVar1 = *(int **)pCVar3;
if (piVar1 != (int *)0x0) {
lVar6 = (longdouble)(**(code **)(*piVar1 + 0x78))(piVar1);
iVar4 = *(int *)(this + 8);
local_50 = (float)lVar6 + local_50;
}
iVar5 = iVar5 + 1;
pCVar3 = pCVar3 + 0x54;
} while (iVar5 < iVar4);
if (local_50 <= 1.0) {
local_50 = 1.0;
}
}
local_40 = *(float *)(param_1 + 0x1c);
local_3c = *(float *)(param_1 + 0x20);
local_38 = *(float *)(param_1 + 0x24);
local_34 = *(float *)(param_1 + 0x10);
local_30 = *(float *)(param_1 + 0x14);
local_2c = *(float *)(param_1 + 0x18);
if ((-1 < iVar2) && (iVar2 < iVar4)) {
piVar1 = *(int **)(this + iVar2 * 0x54 + 0x20);
if (piVar1 != (int *)0x0) {
(**(code **)(*piVar1 + 0xf4))(piVar1,&local_40);
(**(code **)(**(int **)(this + iVar2 * 0x54 + 0x20) + 0xc4))
(*(int **)(this + iVar2 * 0x54 + 0x20),&local_34,0);
}
}
if (((vec3_origin == local_34) && (DAT_01053d4c == local_30)) && (DAT_01053d50 == local_2c)) {
return;
}
if (0 < *(int *)(this + 8)) {
iVar4 = 0;
pCVar3 = this;
do {
if ((iVar2 != iVar4) && (piVar1 = *(int **)(pCVar3 + 0x20), piVar1 != (int *)0x0)) {
lVar6 = (longdouble)(**(code **)(*piVar1 + 0x78))(piVar1);
local_20 = (float)lVar6 * (1.0 / local_50);
local_28 = local_40 * local_20;
local_24 = local_3c * local_20;
local_20 = local_20 * local_38;
(**(code **)(**(int **)(pCVar3 + 0x20) + 0xf8))
(*(int **)(pCVar3 + 0x20),&local_28,&local_34);
}
iVar4 = iVar4 + 1;
pCVar3 = pCVar3 + 0x54;
} while (iVar4 < *(int *)(this + 8));
}
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.