CGasCan::Event_Killed
0x00538ba0 · 1713 bytes · __thiscall
_ZN7CGasCan12Event_KilledERK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* CGasCan::Event_Killed(CTakeDamageInfo const&) */
void __thiscall CGasCan::Event_Killed(CGasCan *this,CTakeDamageInfo *param_1)
{
uint uVar1;
code *pcVar2;
char cVar3;
CInferno *this_00;
int iVar4;
int *piVar5;
undefined4 uVar6;
CTerrorPlayer *pCVar7;
undefined *puVar8;
int in_GS_OFFSET;
float fVar9;
CBaseEntity *local_1f0;
CTraceFilterSimple local_1ec [16];
float local_1dc;
float local_1d8;
float local_1d4;
undefined4 local_1d0;
float local_1cc;
float local_1c8;
float local_1c4;
undefined4 local_1bc;
undefined4 local_1b8;
undefined4 local_1b4;
undefined4 local_1ac;
undefined4 local_1a8;
undefined4 local_1a4;
undefined4 local_19c;
undefined1 local_198;
undefined1 local_197;
Vector local_180 [12];
Vector local_174 [12];
Vector local_168 [42];
byte local_13e;
CFmtStrN<256> local_12c [5];
undefined1 local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (((byte)this[0x14d] & 8) == 0) {
local_1d4 = *(float *)(this + 0x2e8);
local_1c8 = 0.0;
local_1cc = 0.0;
local_1c4 = local_1d4 - 999999.9;
fVar9 = 0.0;
local_1dc = *(float *)(this + 0x2e0);
local_1d8 = *(float *)(this + 0x2e4);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
local_1d4 = *(float *)(this + 0x2e8);
local_1dc = *(float *)(this + 0x2e0);
local_1d8 = *(float *)(this + 0x2e4);
local_1c4 = local_1d4 - 999999.9;
if (((byte)this[0x14d] & 8) == 0) {
local_1cc = 0.0;
local_1c8 = 0.0;
fVar9 = local_1cc;
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
local_1c8 = local_1d8 - *(float *)(this + 0x2e4);
local_1d4 = *(float *)(this + 0x2e8);
local_1cc = local_1dc - *(float *)(this + 0x2e0);
fVar9 = local_1c8 * local_1c8 + local_1cc * local_1cc;
local_1dc = *(float *)(this + 0x2e0);
local_1d8 = *(float *)(this + 0x2e4);
}
}
local_1d4 = local_1d4 + 10.0;
local_1c4 = local_1c4 - local_1d4;
local_1a4 = 0;
local_1a8 = 0;
local_1ac = 0;
local_197 = local_1c4 * local_1c4 + fVar9 != 0.0;
local_198 = 1;
local_19c = 0;
local_1b4 = 0;
local_1b8 = 0;
local_1bc = 0;
CTraceFilterSimple::CTraceFilterSimple
(local_1ec,(IHandleEntity *)this,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))
(enginetrace,(CAI_Concept *)&local_1dc,0x1400b,local_1ec,local_180);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_180,local_174,0xff,0,0,true,-1.0);
}
if ((local_13e & 4) == 0) {
local_1f0 = (CBaseEntity *)0x0;
uVar1 = *(uint *)(param_1 + 0x30);
if (((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
local_1f0 = *(CBaseEntity **)(puVar8 + 4);
}
local_1dc = 0.0;
local_1d8 = 0.0;
local_1d4 = 0.0;
this_00 = (CInferno *)CBaseEntity::Create("inferno",local_174,(QAngle *)&local_1dc,local_1f0);
CInferno::StartBurning(this_00,local_174,local_168,(Vector *)&vec3_origin,0);
}
uVar1 = *(uint *)(param_1 + 0x34);
if (((((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar8 + 8) == uVar1 >> 0xc &&
((piVar5 = *(int **)(puVar8 + 4), piVar5 != (int *)0x0 &&
(cVar3 = (**(code **)(*piVar5 + 0x16c))(piVar5), cVar3 != '\0')))))) &&
(cVar3 = (**(code **)(*piVar5 + 0x778))(piVar5), cVar3 == '\0')) &&
((*(uint *)(param_1 + 0x48) & 0x20000002) != 0)) {
pcVar2 = *(code **)(*piVar5 + 0x7b4);
uVar6 = GetNumCansToWin();
CFmtStrN<256>::CFmtStrN(local_12c,"ToWin:%d",uVar6);
CAI_Concept::CAI_Concept((CAI_Concept *)&local_1dc,"PlayerShotGasCan");
(*pcVar2)(piVar5,(CAI_Concept *)&local_1dc,1,local_127,0,0,0);
}
COutputEvent::FireOutput
((COutputEvent *)(this + 0x1804),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
iVar4 = (**(code **)(*(int *)this + 0x72c))(this);
if (iVar4 != 0) {
local_1dc = 0.0;
local_1d0 = 0xffffffff;
local_1cc = 0.0;
CEventQueue::AddEvent
((CEventQueue *)g_EventQueue,iVar4,"SpawnItem",(CAI_Concept *)&local_1dc,
*(undefined4 *)(scavenge_item_respawn_delay._28_4_ + 0x2c),this,this,0);
}
uVar1 = *(uint *)(param_1 + 0x34);
if ((((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) &&
((piVar5 = *(int **)(puVar8 + 4), piVar5 != (int *)0x0 &&
(cVar3 = (**(code **)(*piVar5 + 0x16c))(piVar5), cVar3 != '\0')))) {
cVar3 = CTerrorGameRules::IsScavengeMode();
if (cVar3 != '\0') {
uVar1 = *(uint *)(param_1 + 0x34);
pCVar7 = (CTerrorPlayer *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
pCVar7 = *(CTerrorPlayer **)(puVar8 + 4);
}
CTerrorPlayer::SendGasCanDestroyMessage(pCVar7);
}
piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"scavenge_gas_can_destroyed",0,0);
if (piVar5 != (int *)0x0) {
local_1f0 = (CBaseEntity *)0x0;
pcVar2 = *(code **)(*piVar5 + 0x30);
uVar1 = *(uint *)(param_1 + 0x34);
if (((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
local_1f0 = *(CBaseEntity **)(puVar8 + 4);
}
uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)((int)local_1f0 + 0x30));
(*pcVar2)(piVar5,"userid",uVar6);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
}
}
uVar1 = *(uint *)(this + 0x220);
if ((((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar8 + 8) == uVar1 >> 0xc &&
((pCVar7 = *(CTerrorPlayer **)(puVar8 + 4), pCVar7 != (CTerrorPlayer *)0x0 &&
(cVar3 = (**(code **)(*(int *)pCVar7 + 0x16c))(pCVar7), cVar3 != '\0')))))) &&
((cVar3 = CTerrorPlayer::IsPerformingAction(pCVar7,0), cVar3 != '\0' &&
(iVar4 = CTerrorPlayer::GetCurrentUseAction(pCVar7), iVar4 == 8)))) {
CTerrorPlayer::StopUseActions(pCVar7);
}
CBaseEntity::Event_Killed((CBaseEntity *)this,param_1);
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.