CGib::WaitTillLand
0x006d47f0 · 877 bytes · __thiscall
_ZN4CGib12WaitTillLandEv
Decompiled
undefined (1 param)
/* CGib::WaitTillLand() */
void __thiscall CGib::WaitTillLand(CGib *this)
{
CBaseEdict *pCVar1;
uint uVar2;
char cVar3;
int iVar4;
CEntityFlame *this_00;
CSprite *this_01;
undefined *puVar5;
undefined *puVar6;
longdouble lVar7;
float fVar8;
undefined4 uVar9;
undefined4 uVar10;
undefined1 local_24 [20];
cVar3 = CBaseEntity::IsInWorld((CBaseEntity *)this);
if (cVar3 == '\0') {
UTIL_Remove((CBaseEntity *)this);
return;
}
if (((byte)this[0x14d] & 0x10) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
}
if (((vec3_origin == *(float *)(this + 0x274)) && (DAT_01053d4c == *(float *)(this + 0x278))) &&
(DAT_01053d50 == *(float *)(this + 0x27c))) {
if (this[0x127] != (CGib)0xff) {
if (this[0x6c] == (CGib)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CGib)((byte)this[0x70] | 1);
}
this[0x127] = (CGib)0xff;
}
if (this[0x121] != (CGib)0x2) {
if (this[0x6c] == (CGib)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CGib)((byte)this[0x70] | 1);
}
this[0x121] = (CGib)0x2;
}
if (this[0x186] != (CGib)0x6) {
CCollisionProperty::SetSolidFlags
((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 4));
}
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&vec3_angle);
CBaseEntity::SetNextThink
((CBaseEntity *)this,*(float *)(this + 0x1400) + *(float *)(gpGlobals + 0xc),
(char *)0x0);
uVar10 = 0;
uVar9 = 0;
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)CBaseEntity::SUB_FadeOut);
puVar6 = g_pEntityList;
uVar2 = *(uint *)(this + 0x1414);
if (((uVar2 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar5 + 8) == uVar2 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) {
this_01 = (CSprite *)
__dynamic_cast(*(int *)(puVar5 + 4),&CBaseEntity::typeinfo,&CSprite::typeinfo,0,
uVar9,uVar10);
if (this_01 != (CSprite *)0x0) {
fVar8 = *(float *)(this + 0x1400);
if (fVar8 == 0.0) {
lVar7 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0x3f800000,0x40400000);
fVar8 = (float)lVar7;
*(float *)(this + 0x1400) = fVar8;
}
CSprite::SetBrightness(this_01,0,fVar8);
uVar10 = 0;
uVar9 = 0;
CBaseEntity::ThinkSet
((_func_void *)local_24,(float)this_01,(char *)CSprite::AnimateUntilDead);
iVar4 = gpGlobals;
*(float *)(this_01 + 0x450) = fVar8 + *(float *)(gpGlobals + 0xc);
CBaseEntity::SetNextThink((CBaseEntity *)this_01,*(float *)(iVar4 + 0xc),(char *)0x0);
puVar6 = g_pEntityList;
}
}
uVar2 = *(uint *)(this + 0x1418);
if (((uVar2 != 0xffffffff) &&
(puVar6 = puVar6 + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar6 + 8) == uVar2 >> 0xc && (*(int *)(puVar6 + 4) != 0)))) {
this_00 = (CEntityFlame *)
__dynamic_cast(*(int *)(puVar6 + 4),&CBaseEntity::typeinfo,&CEntityFlame::typeinfo,0
,uVar9,uVar10);
if (this_00 != (CEntityFlame *)0x0) {
CEntityFlame::SetLifetime(this_00,1.0);
return;
}
}
}
else {
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.5,(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.