CAmbientGeneric::Spawn
0x005dd8c0 · 559 bytes · __thiscall
_ZN15CAmbientGeneric5SpawnEv
Decompiled
undefined (1 param)
/* CAmbientGeneric::Spawn() */
void __thiscall CAmbientGeneric::Spawn(CAmbientGeneric *this)
{
float fVar1;
int iVar2;
undefined4 uVar3;
undefined1 *puVar4;
longdouble lVar5;
undefined4 uVar6;
undefined8 uVar7;
undefined8 in_stack_ffffffb8;
uint uVar9;
longlong lVar8;
double local_2c;
double local_24;
undefined1 local_14 [12];
uVar9 = (uint)((ulonglong)in_stack_ffffffb8 >> 0x20);
if ((((byte)this[0x148] & 1) != 0) || (*(float *)(this + 0x440) <= 0.0)) {
iVar2 = 0;
}
else {
lVar5 = (longdouble)__log10_finite((double)*(float *)(this + 0x440) * 0.027777777777777776);
iVar2 = (int)((float)((double)lVar5 * 20.0) + 40.0);
}
*(int *)(this + 0x448) = iVar2;
ComputeMaxAudibleDistance(this);
if ((*(char **)(this + 0x4b4) != (char *)0x0) && (**(char **)(this + 0x4b4) != '\0')) {
CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194));
CBaseEntity::SetMoveType((CBaseEntity *)this,0,0);
lVar8 = (ulonglong)uVar9 << 0x20;
uVar7 = 0;
CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)RampThink);
uVar6 = 0;
uVar3 = 0xbf800000;
CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
this[0x4b0] = (CAmbientGeneric)0x0;
*(undefined4 *)(this + 0x4bc) = 0xffffffff;
*(undefined4 *)(this + 0x4c0) = 0xffffffff;
this[0x4b1] = (CAmbientGeneric)(((byte)this[0x148] & 0x20) == 0);
(**(code **)(*(int *)this + 0x6c))(this,uVar3,uVar6,uVar7,lVar8);
InitModulationParms(this);
return;
}
if (((byte)this[0x14d] & 8) == 0) {
local_2c = (double)*(float *)(this + 0x2e8);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
local_2c = (double)*(float *)(this + 0x2e8);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
local_24 = (double)*(float *)(this + 0x2e4);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
goto LAB_005dd976;
}
}
local_24 = (double)*(float *)(this + 0x2e4);
LAB_005dd976:
fVar1 = *(float *)(this + 0x2e0);
uVar3 = CBaseEntity::GetDebugName((CBaseEntity *)this);
puVar4 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
puVar4 = *(undefined1 **)(this + 0x7c);
}
Warning("Empty %s (%s) at %.2f, %.2f, %.2f\n",puVar4,uVar3,(double)fVar1,local_24,local_2c);
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.