CBaseGrenade::Explode
0x00413050 · 1045 bytes · __thiscall
_ZN12CBaseGrenade7ExplodeEP10CGameTracei
Decompiled
undefined (3 params)
/* CBaseGrenade::Explode(CGameTrace*, int) */
void __thiscall CBaseGrenade::Explode(CBaseGrenade *this,CGameTrace *param_1,int param_2)
{
Vector *pVVar1;
float fVar2;
CBaseEdict *this_00;
uint uVar3;
CBaseEntity *this_01;
int iVar4;
int iVar5;
CBaseEntity *pCVar6;
undefined *puVar7;
code *pcVar8;
undefined4 uVar9;
undefined4 uVar10;
undefined4 uVar11;
CBaseEntity *local_ac;
CTakeDamageInfo *local_a8;
undefined1 local_a4 [16];
undefined4 local_94;
undefined4 local_90;
undefined4 local_8c;
Vector local_88 [12];
float local_7c;
float local_78;
float local_74;
*(undefined4 *)(this + 0x260) = 0;
CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
iVar4 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,&DAT_00d539c2);
if (iVar4 != *(int *)(this + 0xf4)) {
if (this[0x6c] == (CBaseGrenade)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CBaseGrenade)((byte)this[0x70] | 1);
}
*(int *)(this + 0xf4) = iVar4;
}
CCollisionProperty::SetSolidFlags
((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 4));
if (this[0x105] != (CBaseGrenade)0x0) {
(**(code **)(*(int *)this + 0x224))(this,this + 0x105);
this[0x105] = (CBaseGrenade)0x0;
}
if (*(float *)(param_1 + 0x2c) != 1.0) {
local_78 = *(float *)(param_1 + 0x1c) * 0.6 + *(float *)(param_1 + 0x10);
local_74 = *(float *)(param_1 + 0x20) * 0.6 + *(float *)(param_1 + 0x14);
local_7c = *(float *)(param_1 + 0x18) * 0.6 + *(float *)(param_1 + 0xc);
CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)&local_7c);
}
local_a8 = (CTakeDamageInfo *)&local_7c;
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
pVVar1 = (Vector *)(this + 0x2e0);
CSoundEnt::InsertSound(1,pVVar1,0x400,3.0,(CBaseEntity *)0x0,0,(CBaseEntity *)0x0);
uVar3 = *(uint *)(this + 0x1a58);
pCVar6 = (CBaseEntity *)&vec3_origin;
if ((((uVar3 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar3 >> 0xc)) &&
(this_01 = *(CBaseEntity **)(puVar7 + 4), this_01 != (CBaseEntity *)0x0)) {
if (((byte)this_01[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_01);
}
pCVar6 = this_01 + 0x2e0;
}
local_94 = *(undefined4 *)pCVar6;
local_90 = *(undefined4 *)(pCVar6 + 4);
local_8c = *(undefined4 *)(pCVar6 + 8);
CBaseEntity::EmitSound((CBaseEntity *)this,"BaseGrenade.Explode",0.0,(float *)0x0);
fVar2 = *(float *)(this + 0x1a50);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
(**(code **)(*(int *)this + 0x570))(local_88,this);
local_ac = (CBaseEntity *)0x0;
uVar3 = *(uint *)(this + 0x1a58);
if (((uVar3 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar3 >> 0xc)) {
local_ac = *(CBaseEntity **)(puVar7 + 4);
}
CTakeDamageInfo::CTakeDamageInfo
(local_a8,(CBaseEntity *)this,local_ac,local_88,pVVar1,fVar2,param_2,0,
(Vector *)&local_94);
fVar2 = *(float *)(this + 0x1a44);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
RadiusDamage(local_a8,pVVar1,fVar2,0,(CBaseEntity *)0x0);
UTIL_DecalTrace(param_1,"Scorch");
uVar11 = 0;
uVar10 = 0;
pcVar8 = CBaseEntity::SUB_Remove;
uVar9 = 0;
CBaseEntity::ThinkSet((_func_void *)local_a4,(float)this,(char *)CBaseEntity::SUB_Remove);
*(undefined4 *)(this + 0xd8) = 0;
*(undefined4 *)(this + 0xdc) = 0;
CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),0,pcVar8,uVar9,uVar10,uVar11);
CBaseEntity::AddEffects((CBaseEntity *)this,0x20);
CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
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.