CGasCan::OnTakeDamage
0x00538230 · 1188 bytes · __thiscall
_ZN7CGasCan12OnTakeDamageERK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* CGasCan::OnTakeDamage(CTakeDamageInfo const&) */
undefined4 __thiscall CGasCan::OnTakeDamage(CGasCan *this,CTakeDamageInfo *param_1)
{
uint uVar1;
uint uVar2;
int *piVar3;
code *pcVar4;
char cVar5;
undefined4 uVar6;
int iVar7;
CBaseEntity *this_00;
undefined *puVar8;
undefined *puVar9;
longdouble lVar10;
undefined1 local_84 [8];
undefined4 local_7c;
undefined4 local_78;
undefined4 local_74;
undefined4 local_70;
undefined4 local_6c;
undefined4 local_68;
undefined4 local_64;
undefined4 local_60;
undefined4 local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
uint local_4c;
uint local_48;
undefined4 local_44;
float local_40;
undefined4 local_3c;
undefined4 local_38;
uint local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
local_7c = *(undefined4 *)param_1;
local_78 = *(undefined4 *)(param_1 + 4);
local_74 = *(undefined4 *)(param_1 + 8);
local_70 = *(undefined4 *)(param_1 + 0xc);
local_6c = *(undefined4 *)(param_1 + 0x10);
local_68 = *(undefined4 *)(param_1 + 0x14);
local_64 = *(undefined4 *)(param_1 + 0x18);
local_60 = *(undefined4 *)(param_1 + 0x1c);
local_5c = *(undefined4 *)(param_1 + 0x20);
local_58 = *(undefined4 *)(param_1 + 0x24);
local_54 = *(undefined4 *)(param_1 + 0x28);
local_50 = *(undefined4 *)(param_1 + 0x2c);
local_4c = *(uint *)(param_1 + 0x30);
local_48 = *(uint *)(param_1 + 0x34);
local_44 = *(undefined4 *)(param_1 + 0x38);
local_40 = *(float *)(param_1 + 0x3c);
uVar1 = *(uint *)(param_1 + 0x48);
local_3c = *(undefined4 *)(param_1 + 0x40);
local_30 = *(undefined4 *)(param_1 + 0x4c);
local_38 = *(undefined4 *)(param_1 + 0x44);
local_24 = *(undefined4 *)(param_1 + 0x58);
local_2c = *(undefined4 *)(param_1 + 0x50);
local_28 = *(undefined4 *)(param_1 + 0x54);
local_20 = *(undefined4 *)(param_1 + 0x5c);
local_34 = uVar1;
if ((uVar1 & 0x400) == 0) {
if (uVar1 != 0x80) goto joined_r0x00538379;
local_40 = 0.0;
}
else {
if (this[0x1824] == (CGasCan)0x0) {
return 0;
}
if (*(float *)(this + 0x1828) == 0.0) {
*(float *)(this + 0x1828) =
*(float *)(gascan_spit_time._28_4_ + 0x2c) + *(float *)(gpGlobals + 0xc);
if (this[0x204] == (CGasCan)0x0) {
(**(code **)(*(int *)(this + 0x1f0) + 4))(this + 0x1f0,this + 0x204);
this[0x204] = (CGasCan)0x1;
}
CBaseEntity::ThinkSet((_func_void *)local_84,(float)this,(char *)ClearDetonateTimer);
}
else {
if (*(float *)(gpGlobals + 0xc) <= *(float *)(this + 0x1828)) {
CBaseEntity::ThinkSet((_func_void *)local_84,(float)this,(char *)ClearDetonateTimer);
return 0;
}
local_40 = (float)*(int *)(this + 0x100) + 1.0;
}
joined_r0x00538379:
if ((uVar1 == 0x8000040) && (local_40 = 0.0, this[0x1824] == (CGasCan)0x0)) {
return 0;
}
}
if (((((local_48 != 0xffffffff) &&
(puVar9 = g_pEntityList + (local_48 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == local_48 >> 0xc)) &&
((piVar3 = *(int **)(puVar9 + 4), piVar3 != (int *)0x0 &&
(cVar5 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar5 != '\0')))) &&
(cVar5 = (**(code **)(*piVar3 + 0x778))(piVar3), cVar5 != '\0')) {
local_40 = 0.0;
}
puVar9 = g_pEntityList;
if ((uVar1 & 8) == 0) {
LAB_00538491:
uVar6 = CBaseEntity::OnTakeDamage((CBaseEntity *)this,(CTakeDamageInfo *)&local_7c);
return uVar6;
}
if ((((local_4c != 0xffffffff) &&
(puVar8 = g_pEntityList + (local_4c & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar8 + 8) == local_4c >> 0xc &&
(((*(int *)(puVar8 + 4) != 0 &&
(iVar7 = __dynamic_cast(*(int *)(puVar8 + 4),&CBaseEntity::typeinfo,&CEntityFlame::typeinfo
,0), iVar7 != 0)) &&
(uVar2 = *(uint *)(iVar7 + 0x180), uVar2 != 0xffffffff)))))) &&
(((puVar9 = puVar9 + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc &&
(*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) &&
((piVar3 = *(int **)(puVar9 + 4), piVar3 != (int *)0x0 &&
(cVar5 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar5 != '\0')))))) {
uVar2 = *(uint *)(iVar7 + 0x180);
if (((uVar2 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar9 + 8) != uVar2 >> 0xc ||
((this_00 = *(CBaseEntity **)(puVar9 + 4), this_00 == (CBaseEntity *)0x0 ||
(cVar5 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar5 == '\0')))))) {
this_00 = (CBaseEntity *)0x0;
}
iVar7 = CBaseEntity::GetTeamNumber(this_00);
if (iVar7 == 3) {
return 0;
}
}
if ((((byte)this[0x153] & 8) == 0) || ((uVar1 & 0x10000000) != 0)) {
if (*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x181c) < 0.5) {
OnTakeDamage(CTakeDamageInfo_const&)::nImmuneTime =
*(int *)(scavenge_item_respawn_delay._28_4_ + 0x30);
}
else if ((float)OnTakeDamage(CTakeDamageInfo_const&)::nImmuneTime + *(float *)(this + 0x181c) <=
*(float *)(gpGlobals + 0xc)) {
if (local_40 < (float)*(int *)(this + 0x100)) {
pcVar4 = *(code **)(*(int *)this + 0x380);
lVar10 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0x41200000,0x41700000);
(*pcVar4)(this,(float)lVar10,0,0,0);
}
goto LAB_00538491;
}
}
return 0;
}
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.