CCSPlayer::RecordDamageTaken
0x0065c7e0 · 232 bytes · __thiscall
_ZN9CCSPlayer17RecordDamageTakenEPKci
Decompiled
undefined (3 params)
/* CCSPlayer::RecordDamageTaken(char const*, int) */
void __thiscall CCSPlayer::RecordDamageTaken(CCSPlayer *this,char *param_1,int param_2)
{
int iVar1;
char *pcVar2;
int iVar3;
int iVar4;
iVar3 = *(int *)(this + 0x29ec);
if (iVar3 != -1) {
iVar4 = *(int *)(this + 0x29e0);
do {
iVar1 = V_strncmp(param_1,*(char **)(iVar4 + iVar3 * 0xc),0x20);
iVar4 = s_BulletGroupCounter;
if (iVar1 == 0) {
iVar3 = *(int *)(*(int *)(this + 0x29e0) + iVar3 * 0xc);
*(int *)(iVar3 + 0x20) = *(int *)(iVar3 + 0x20) + param_2;
if (iVar4 != *(int *)(iVar3 + 0x28)) {
*(int *)(iVar3 + 0x24) = *(int *)(iVar3 + 0x24) + 1;
}
*(int *)(iVar3 + 0x28) = iVar4;
return;
}
iVar4 = *(int *)(this + 0x29e0);
iVar3 = *(int *)(iVar4 + 8 + iVar3 * 0xc);
} while (iVar3 != -1);
}
pcVar2 = ::operator_new(0x2c);
iVar3 = s_BulletGroupCounter;
/* try { // try from 0065c88d to 0065c891 has its CatchHandler @ 0065c8d1 */
V_strncpy(pcVar2,param_1,0x20);
pcVar2[0x24] = '\x01';
pcVar2[0x25] = '\0';
pcVar2[0x26] = '\0';
pcVar2[0x27] = '\0';
*(int *)(pcVar2 + 0x20) = param_2;
*(int *)(pcVar2 + 0x28) = iVar3;
iVar3 = CUtlLinkedList<CDamageRecord*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CDamageRecord*,int>,int>>
::InsertBefore((CUtlLinkedList<CDamageRecord*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CDamageRecord*,int>,int>>
*)(this + 0x29e0),-1);
*(char **)(*(int *)(this + 0x29e0) + iVar3 * 0xc) = pcVar2;
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.