CTerrorGameRules::DeathNoticeForInfected
0x00504cd0 · 783 bytes · __thiscall
_ZN16CTerrorGameRules22DeathNoticeForInfectedEP20CBaseCombatCharacterRK15CTakeDamageInfo
Decompiled
undefined (3 params)
/* CTerrorGameRules::DeathNoticeForInfected(CBaseCombatCharacter*, CTakeDamageInfo const&) */
void __thiscall
CTerrorGameRules::DeathNoticeForInfected
(CTerrorGameRules *this,CBaseCombatCharacter *param_1,CTakeDamageInfo *param_2)
{
uint uVar1;
code *pcVar2;
int *piVar3;
int *piVar4;
char *pcVar5;
int iVar6;
int iVar7;
undefined4 uVar8;
undefined *puVar9;
bool bVar10;
int *piVar11;
int *local_24;
int local_20;
piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"infected_death",0,0);
if (piVar4 == (int *)0x0) {
return;
}
uVar1 = *(uint *)(param_2 + 0x30);
local_20 = 0;
if (((uVar1 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) {
local_20 = *(int *)(puVar9 + 4);
}
uVar1 = *(uint *)(param_2 + 0x34);
if (((uVar1 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar9 + 8) != uVar1 >> 0xc ||
((piVar11 = *(int **)(puVar9 + 4), piVar11 != (int *)0x0 &&
(iVar6 = (**(code **)(*piVar11 + 0x100))(piVar11), iVar6 != 1)))))) {
piVar11 = (int *)0x0;
}
uVar1 = *(uint *)(param_2 + 0x38);
local_24 = (int *)0x0;
if ((((uVar1 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) &&
(piVar3 = *(int **)(puVar9 + 4), piVar3 != (int *)0x0)) {
local_24 = (int *)(**(code **)(*piVar3 + 0x188))(piVar3);
}
uVar1 = *(uint *)(param_2 + 0x48);
if (local_20 == 0) {
bVar10 = false;
}
else {
pcVar5 = *(char **)(local_20 + 0x7c);
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
}
iVar6 = _V_stricmp(pcVar5,"prop_minigun");
pcVar5 = *(char **)(local_20 + 0x7c);
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
}
iVar7 = _V_stricmp(pcVar5,"prop_minigun_l4d1");
bVar10 = iVar7 == 0 || iVar6 == 0;
pcVar5 = "";
if (*(char **)(local_20 + 0x7c) != (char *)0x0) {
pcVar5 = *(char **)(local_20 + 0x7c);
}
iVar6 = _V_stricmp(pcVar5,"grenade_launcher_projectile");
if (iVar6 == 0) {
(**(code **)(*piVar4 + 0x30))(piVar4,"weapon_id",0x15);
iVar6 = *piVar4;
goto joined_r0x00504f5c;
}
}
iVar6 = *piVar4;
joined_r0x00504f5c:
if (piVar11 == (int *)0x0) {
(**(code **)(iVar6 + 0x30))(piVar4,"attacker",0);
}
else {
pcVar2 = *(code **)(iVar6 + 0x30);
uVar8 = (**(code **)(*engine + 0x40))(engine,piVar11[0xc]);
(*pcVar2)(piVar4,"attacker",uVar8);
}
if (local_24 != (int *)0x0) {
pcVar2 = *(code **)(*piVar4 + 0x30);
uVar8 = (**(code **)(*local_24 + 0x638))(local_24);
(*pcVar2)(piVar4,"weapon_id",uVar8);
}
if (param_1 != (CBaseCombatCharacter *)0x0) {
pcVar2 = *(code **)(*piVar4 + 0x30);
uVar8 = CBaseEntity::GetGender((CBaseEntity *)param_1);
(*pcVar2)(piVar4,"gender",uVar8);
(**(code **)(*piVar4 + 0x2c))(piVar4,"submerged",param_1[0x253] != (CBaseCombatCharacter)0x0);
}
(**(code **)(*piVar4 + 0x2c))(piVar4,"headshot",(byte)(uVar1 >> 0x1e) & 1);
(**(code **)(*piVar4 + 0x2c))(piVar4,"minigun",bVar10);
(**(code **)(*piVar4 + 0x2c))(piVar4,"blast",(byte)(uVar1 >> 6) & 1);
/* WARNING: Could not recover jumptable at 0x00504f39. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*gameeventmanager + 0x20))();
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.