CGib::DieThink
0x006d4200 · 484 bytes · __thiscall
_ZN4CGib8DieThinkEv
Decompiled
undefined (1 param)
/* CGib::DieThink() */
void __thiscall CGib::DieThink(CGib *this)
{
uint uVar1;
int iVar2;
char cVar3;
CEntityFlame *this_00;
CSprite *this_01;
undefined *puVar4;
undefined *puVar5;
undefined1 local_24 [20];
puVar5 = g_pEntityList;
uVar1 = *(uint *)(this + 0x1414);
if ((((uVar1 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
this_01 = (CSprite *)
__dynamic_cast(*(int *)(puVar4 + 4),&CBaseEntity::typeinfo,&CSprite::typeinfo,0);
if (this_01 != (CSprite *)0x0) {
CSprite::SetBrightness(this_01,0,0.0);
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this_01,(char *)CSprite::AnimateUntilDead)
;
iVar2 = gpGlobals;
*(undefined4 *)(this_01 + 0x450) = *(undefined4 *)(gpGlobals + 0xc);
CBaseEntity::SetNextThink((CBaseEntity *)this_01,*(float *)(iVar2 + 0xc),(char *)0x0);
puVar5 = g_pEntityList;
}
}
uVar1 = *(uint *)(this + 0x1418);
if (((uVar1 != 0xffffffff) &&
(puVar5 = puVar5 + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) {
this_00 = (CEntityFlame *)
__dynamic_cast(*(int *)(puVar5 + 4),&CBaseEntity::typeinfo,&CEntityFlame::typeinfo,0);
if (this_00 != (CEntityFlame *)0x0) {
CEntityFlame::SetLifetime(this_00,1.0);
}
}
cVar3 = (**(code **)(*g_pGameRules + 0x88))(g_pGameRules);
if (cVar3 == '\0') {
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)CBaseEntity::SUB_FadeOut);
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
return;
}
UTIL_Remove((CBaseEntity *)this);
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.