CCSPlayer::OnTakeDamageInternal
0x00656da0 · 348 bytes · __thiscall
_ZN9CCSPlayer20OnTakeDamageInternalER15CTakeDamageInfo
Decompiled
undefined (2 params)
/* CCSPlayer::OnTakeDamageInternal(CTakeDamageInfo&) */
void __thiscall CCSPlayer::OnTakeDamageInternal(CCSPlayer *this,CTakeDamageInfo *param_1)
{
uint uVar1;
CBaseEdict *pCVar2;
char cVar3;
int iVar4;
CBaseEntity *pCVar5;
undefined *puVar6;
pCVar5 = (CBaseEntity *)0x0;
uVar1 = *(uint *)(param_1 + 0x34);
if (((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) {
pCVar5 = *(CBaseEntity **)(puVar6 + 4);
}
cVar3 = ShouldDoLargeFlinch(this,*(int *)(this + 0x1838),pCVar5);
if (cVar3 == '\0') {
if (*(float *)(this + 0x2854) != 0.5) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2854) = 0x3f000000;
return;
}
}
else {
if (((byte)this[0x14d] & 0x10) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
}
if ((SQRT(*(float *)(this + 0x274) * *(float *)(this + 0x274) +
*(float *)(this + 0x27c) * *(float *)(this + 0x27c) +
*(float *)(this + 0x278) * *(float *)(this + 0x278)) < 300.0) &&
(*(float *)(this + 0x2854) != 0.65)) {
if (this[0x6c] == (CCSPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2854) = 0x3f266666;
}
}
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.