CCSGameRules::PopulateDeathEvent
0x00433340 · 963 bytes · __thiscall
_ZN12CCSGameRules18PopulateDeathEventEP10IGameEventPK11CBaseEntityPK20CBaseCombatCharacterRK15CTakeDamageInfo
Decompiled
undefined (5 params)
/* CCSGameRules::PopulateDeathEvent(IGameEvent*, CBaseEntity const*, CBaseCombatCharacter const*,
CTakeDamageInfo const&) */
void __thiscall
CCSGameRules::PopulateDeathEvent
(CCSGameRules *this,IGameEvent *param_1,CBaseEntity *param_2,CBaseCombatCharacter *param_3
,CTakeDamageInfo *param_4)
{
uint uVar1;
char cVar2;
CTerrorPlayer *this_00;
undefined4 uVar3;
int *piVar4;
int iVar5;
code *UNRECOVERED_JUMPTABLE;
char *pcVar6;
undefined *puVar7;
CBaseEntity *pCVar8;
char *pcVar9;
CBaseCombatCharacter *this_01;
char *pcVar10;
bool bVar11;
undefined1 uVar12;
undefined1 uVar13;
byte bVar14;
byte local_28;
bVar14 = 0;
this_01 = (CBaseCombatCharacter *)0x0;
uVar1 = *(uint *)(param_4 + 0x30);
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
this_01 = *(CBaseCombatCharacter **)(puVar7 + 4);
}
pCVar8 = (CBaseEntity *)0x0;
uVar1 = *(uint *)(param_4 + 0x34);
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
pCVar8 = *(CBaseEntity **)(puVar7 + 4);
}
this_00 = (CTerrorPlayer *)
CMultiplayRules::GetDeathScorer((CMultiplayRules *)this,pCVar8,(CBaseEntity *)this_01);
if (this_00 == (CTerrorPlayer *)0x0) {
pcVar6 = *(char **)(this_01 + 0x7c);
if (pcVar6 == (char *)0x0) {
pcVar6 = "";
}
(**(code **)(*(int *)param_1 + 0x30))(param_1,"attacker",0);
if (*(int *)(pCVar8 + 0x30) == 0) {
iVar5 = 0;
uVar12 = true;
}
else {
iVar5 = *(int *)(pCVar8 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
uVar12 = iVar5 == 0;
}
(**(code **)(*(int *)param_1 + 0x30))(param_1,"attackerentid",iVar5);
local_28 = 0;
LAB_0043343d:
iVar5 = 7;
pcVar9 = pcVar6;
pcVar10 = "weapon_";
do {
uVar13 = uVar12;
if (iVar5 == 0) break;
iVar5 = iVar5 + -1;
uVar12 = *pcVar9 == *pcVar10;
pcVar9 = pcVar9 + (uint)bVar14 * -2 + 1;
pcVar10 = pcVar10 + (uint)bVar14 * -2 + 1;
uVar13 = uVar12;
} while ((bool)uVar12);
uVar12 = false;
if ((bool)uVar13) {
pcVar6 = pcVar6 + 7;
goto LAB_00433454;
}
LAB_00433565:
iVar5 = 5;
pcVar9 = pcVar6;
pcVar10 = "NPC_";
do {
if (iVar5 == 0) break;
iVar5 = iVar5 + -1;
uVar12 = *pcVar9 == *pcVar10;
pcVar9 = pcVar9 + (uint)bVar14 * -2 + 1;
pcVar10 = pcVar10 + (uint)bVar14 * -2 + 1;
} while ((bool)uVar12);
if (!(bool)uVar12) goto LAB_004335c0;
LAB_00433575:
pcVar6 = pcVar6 + 8;
LAB_00433454:
if (pcVar6 != "pistol") goto LAB_00433460;
}
else {
UNRECOVERED_JUMPTABLE = *(code **)(*(int *)param_1 + 0x30);
uVar3 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
(*UNRECOVERED_JUMPTABLE)(param_1,"attacker",uVar3);
bVar11 = this_01 == (CBaseCombatCharacter *)0x0;
local_28 = (byte)((uint)*(undefined4 *)(param_4 + 0x48) >> 0x1e) & 1;
if (!bVar11) {
if (this_00 == (CTerrorPlayer *)this_01) {
iVar5 = CBaseCombatCharacter::GetActiveWeapon(this_01);
bVar11 = true;
if (iVar5 == 0) goto LAB_00433700;
iVar5 = CBaseCombatCharacter::GetActiveWeapon(this_01);
pcVar6 = *(char **)(iVar5 + 0x7c);
uVar12 = pcVar6 == (char *)0x0;
if (!(bool)uVar12) goto LAB_0043343d;
uVar12 = true;
}
else {
cVar2 = (**(code **)(*(int *)this_01 + 0x16c))(this_01);
if (cVar2 != '\0') {
cVar2 = (**(code **)(*(int *)this_01 + 0x16c))(this_01);
pCVar8 = (CBaseEntity *)0x0;
if (cVar2 != '\0') {
pCVar8 = (CBaseEntity *)this_01;
}
iVar5 = CBaseEntity::GetTeamNumber(pCVar8);
if (iVar5 != 3) goto LAB_00433432;
iVar5 = (**(code **)(*(int *)pCVar8 + 0x544))(pCVar8);
uVar12 = iVar5 == 2;
if (!(bool)uVar12) goto LAB_00433432;
pcVar6 = "boomer";
goto LAB_00433565;
}
LAB_00433432:
pcVar6 = *(char **)(this_01 + 0x7c);
uVar12 = pcVar6 == (char *)0x0;
if (!(bool)uVar12) goto LAB_0043343d;
}
pcVar6 = "";
goto LAB_00433565;
}
LAB_00433700:
pcVar6 = "world";
iVar5 = 5;
pcVar9 = "world";
pcVar10 = "NPC_";
do {
if (iVar5 == 0) break;
iVar5 = iVar5 + -1;
bVar11 = *pcVar9 == *pcVar10;
pcVar9 = pcVar9 + (uint)bVar14 * -2 + 1;
pcVar10 = pcVar10 + (uint)bVar14 * -2 + 1;
} while (bVar11);
if (bVar11) goto LAB_00433575;
LAB_004335c0:
bVar11 = false;
iVar5 = 5;
pcVar9 = pcVar6;
pcVar10 = "func_";
do {
if (iVar5 == 0) break;
iVar5 = iVar5 + -1;
bVar11 = *pcVar9 == *pcVar10;
pcVar9 = pcVar9 + (uint)bVar14 * -2 + 1;
pcVar10 = pcVar10 + (uint)bVar14 * -2 + 1;
} while (bVar11);
if (bVar11) {
pcVar6 = pcVar6 + 5;
goto LAB_00433454;
}
iVar5 = 9;
bVar11 = false;
pcVar9 = pcVar6;
pcVar10 = "hegrenade";
do {
if (iVar5 == 0) break;
iVar5 = iVar5 + -1;
bVar11 = *pcVar9 == *pcVar10;
pcVar9 = pcVar9 + (uint)bVar14 * -2 + 1;
pcVar10 = pcVar10 + (uint)bVar14 * -2 + 1;
} while (bVar11);
if (bVar11) {
pcVar6 = "hegrenade";
}
else {
iVar5 = 9;
bVar11 = false;
pcVar9 = pcVar6;
pcVar10 = "pipe_bomb";
do {
if (iVar5 == 0) break;
iVar5 = iVar5 + -1;
bVar11 = *pcVar9 == *pcVar10;
pcVar9 = pcVar9 + (uint)bVar14 * -2 + 1;
pcVar10 = pcVar10 + (uint)bVar14 * -2 + 1;
} while (bVar11);
if (bVar11) {
pcVar6 = "pipe_bomb";
}
else {
iVar5 = 9;
bVar11 = false;
pcVar9 = pcVar6;
pcVar10 = "flashbang";
do {
if (iVar5 == 0) break;
iVar5 = iVar5 + -1;
bVar11 = *pcVar9 == *pcVar10;
pcVar9 = pcVar9 + (uint)bVar14 * -2 + 1;
pcVar10 = pcVar10 + (uint)bVar14 * -2 + 1;
} while (bVar11);
if (!bVar11) goto LAB_00433454;
pcVar6 = "flashbang";
}
}
LAB_00433460:
iVar5 = _V_stricmp(pcVar6,"pistol");
if (iVar5 != 0) goto LAB_0043347a;
}
if (((this_00 != (CTerrorPlayer *)0x0) &&
(piVar4 = (int *)CTerrorPlayer::GetActiveTerrorWeapon(this_00), piVar4 != (int *)0x0)) &&
(cVar2 = (**(code **)(*piVar4 + 0x674))(piVar4), cVar2 != '\0')) {
pcVar6 = "dual_pistols";
}
LAB_0043347a:
(**(code **)(*(int *)param_1 + 0x3c))(param_1,"weapon",pcVar6);
if (local_28 == 0) {
(**(code **)(*(int *)param_1 + 0x30))(param_1,"headshot",0);
(**(code **)(*(int *)param_1 + 0x30))(param_1,"type",*(undefined4 *)(param_4 + 0x48));
UNRECOVERED_JUMPTABLE = *(code **)(*(int *)param_1 + 0x30);
}
else {
(**(code **)(*(int *)param_1 + 0x30))(param_1,"headshot",1);
(**(code **)(*(int *)param_1 + 0x30))(param_1,"type",*(undefined4 *)(param_4 + 0x48));
UNRECOVERED_JUMPTABLE = *(code **)(*(int *)param_1 + 0x30);
}
/* WARNING: Could not recover jumptable at 0x004334ea. Too many branches */
/* WARNING: Treating indirect jump as call */
(*UNRECOVERED_JUMPTABLE)();
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.