CTerrorMeleeWeapon::GetDamageForVictim
0x00569260 · 246 bytes · __thiscall
_ZN18CTerrorMeleeWeapon18GetDamageForVictimEP11CBaseEntity
Decompiled
undefined (2 params)
/* CTerrorMeleeWeapon::GetDamageForVictim(CBaseEntity*) */
longdouble __thiscall
CTerrorMeleeWeapon::GetDamageForVictim(CTerrorMeleeWeapon *this,CBaseEntity *param_1)
{
int iVar1;
int *piVar2;
undefined4 uVar3;
float fVar4;
iVar1 = CMeleeWeaponInfoStore::GetMeleeWeaponInfo
((CMeleeWeaponInfoStore *)g_MeleeWeaponInfoStore,*(int *)(this + 0x17e0));
piVar2 = (int *)(**(code **)(*(int *)param_1 + 0x144))(param_1);
fVar4 = 175.0;
if (piVar2 != (int *)0x0) {
uVar3 = (**(code **)(*piVar2 + 0x544))(piVar2);
switch(uVar3) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return (longdouble)piVar2[0x40];
case 6:
iVar1 = (**(code **)(*piVar2 + 0x1fc))(piVar2);
return (longdouble)((float)iVar1 * 0.65);
case 7:
iVar1 = (**(code **)(*piVar2 + 0x1fc))(piVar2);
return (longdouble)((float)iVar1 * 0.25);
case 8:
iVar1 = (**(code **)(*piVar2 + 0x1fc))(piVar2);
return (longdouble)((float)iVar1 * 0.05);
default:
fVar4 = *(float *)(iVar1 + 0x120);
}
}
return (longdouble)fVar4;
}
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.