CEnvShooter::CreateGib
0x0066d7e0 · 636 bytes · __thiscall
_ZN11CEnvShooter9CreateGibEv
Decompiled
undefined (1 param)
/* CEnvShooter::CreateGib() */
CGib * __thiscall CEnvShooter::CreateGib(CEnvShooter *this)
{
code *pcVar1;
uint *puVar2;
undefined4 uVar3;
CGib *this_00;
int iVar4;
char *pcVar5;
int *piVar6;
undefined4 *puVar7;
undefined4 *puVar8;
int iVar9;
float fVar10;
CGib *in_stack_ffffffc4;
char *in_stack_ffffffc8;
char *local_20;
puVar8 = (undefined4 *)&stack0xffffffc4;
this_00 = _CreateEntity<CGib>(in_stack_ffffffc4,in_stack_ffffffc8);
if (this[0x479] == (CEnvShooter)0x0) {
(**(code **)(*(int *)this + 0x20))();
puVar8 = (undefined4 *)&stack0xffffffc0;
pcVar5 = "";
if (local_20 != (char *)0x0) {
pcVar5 = local_20;
}
CGib::Spawn(this_00,pcVar5);
}
else {
CGib::Spawn(this_00,"");
}
iVar9 = 0;
if (1 < *(int *)(this + 0x470)) {
iVar9 = *random_valve;
puVar8[2] = *(int *)(this + 0x470) + -1;
puVar8[1] = 0;
*puVar8 = random_valve;
pcVar1 = *(code **)(iVar9 + 8);
puVar8[-1] = 0x66d83a;
iVar9 = (*pcVar1)();
}
if (iVar9 != *(int *)(this_00 + 0x45c)) {
if (this_00[0x6c] == (CGib)0x0) {
puVar2 = *(uint **)(this_00 + 0x30);
if (puVar2 != (uint *)0x0) {
*puVar2 = *puVar2 | 0x101;
*puVar8 = puVar2;
puVar8[-1] = 0x66d863;
iVar4 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*puVar8);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this_00[0x70] = (CGib)((byte)this_00[0x70] | 1);
}
*(int *)(this_00 + 0x45c) = iVar9;
}
puVar8[1] = 0xffffffff;
*puVar8 = this_00;
puVar8[-1] = 0x66d87f;
CGib::SetBloodColor((CGib *)*puVar8,puVar8[1]);
*(undefined4 *)(this_00 + 0x13fc) = *(undefined4 *)(this + 0x448);
this_00[0x121] = *(CGib *)(this + 0x121);
if ((((this_00[0x124] != *(CGib *)(this + 0x124)) || (this_00[0x125] != *(CGib *)(this + 0x125)))
|| (this_00[0x126] != *(CGib *)(this + 0x126))) || (this_00[0x127] != *(CGib *)(this + 0x127))
) {
if (this_00[0x6c] == (CGib)0x0) {
puVar2 = *(uint **)(this_00 + 0x30);
if (puVar2 != (uint *)0x0) {
*puVar2 = *puVar2 | 0x101;
*puVar8 = puVar2;
puVar8[-1] = 0x66d8ca;
iVar9 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*puVar8);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this_00[0x70] = (CGib)((byte)this_00[0x70] | 1);
}
*(undefined4 *)(this_00 + 0x124) = *(undefined4 *)(this + 0x124);
}
this_00[0x120] = *(CGib *)(this + 0x120);
iVar9 = *(int *)(this + 0x480);
if (iVar9 != *(int *)(this_00 + 0x458)) {
if (this_00[0x6c] == (CGib)0x0) {
puVar2 = *(uint **)(this_00 + 0x30);
if (puVar2 != (uint *)0x0) {
*puVar2 = *puVar2 | 0x101;
*puVar8 = puVar2;
puVar8[-1] = 0x66d916;
iVar4 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*puVar8);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this_00[0x70] = (CGib)((byte)this_00[0x70] | 1);
}
*(int *)(this_00 + 0x458) = iVar9;
}
fVar10 = *(float *)(this + 0x468) + *(float *)(gpGlobals + 0xc);
*(float *)(this_00 + 0x1400) = fVar10;
*(undefined4 *)(this_00 + 0x2c0) = *(undefined4 *)(this + 0x488);
if (((byte)this[0x148] & 2) != 0) {
puVar8[3] = 1;
puVar8[2] = 0;
puVar8[1] = fVar10;
*puVar8 = this_00;
puVar8[-1] = 0x66da2e;
piVar6 = (int *)CEntityFlame::Create
((CBaseEntity *)*puVar8,(float)puVar8[1],(float)puVar8[2],
*(bool *)(puVar8 + 3));
if (piVar6 != (int *)0x0) {
iVar9 = *piVar6;
*puVar8 = piVar6;
pcVar1 = *(code **)(iVar9 + 0xc);
puVar8[-1] = 0x66da3e;
puVar7 = (undefined4 *)(*pcVar1)();
*(undefined4 *)(this_00 + 0x1418) = *puVar7;
}
}
if (*(int *)(this + 0x47c) != 0) {
uVar3 = *(undefined4 *)(this + 0x47c);
*puVar8 = this_00;
puVar8[1] = uVar3;
puVar8[-1] = 0x66d975;
CBaseAnimating::SetLightingOrigin();
}
if (this[0x478] != (CEnvShooter)0x0) {
puVar8[1] = 0x10;
*puVar8 = this_00;
puVar8[-1] = 0x66d98e;
CBaseEntity::AddEffects((CBaseEntity *)*puVar8,puVar8[1]);
}
return this_00;
}
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.