CDynamicProp::Spawn
0x007ef7b0 · 842 bytes · __thiscall
_ZN12CDynamicProp5SpawnEv
Decompiled
undefined (1 param)
/* CDynamicProp::Spawn() */
void __thiscall CDynamicProp::Spawn(CDynamicProp *this)
{
CCollisionProperty *this_00;
CGlowProperty *this_01;
CBaseEdict *this_02;
char cVar1;
int iVar2;
uint uVar3;
CDynamicProp CVar4;
longdouble lVar5;
float fVar6;
char *pcVar7;
undefined4 uVar8;
undefined4 uVar9;
undefined4 uVar10;
undefined1 local_14 [8];
if (*(char **)(this + 0x7c) != "dynamic_prop") {
pcVar7 = "dynamic_prop";
cVar1 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)this,"dynamic_prop");
if (cVar1 == '\0') goto LAB_007ef7e0;
}
pcVar7 = "prop_dynamic";
CBaseEntity::SetClassname((char *)this);
LAB_007ef7e0:
this_00 = (CCollisionProperty *)(this + 0x194);
iVar2 = (**(code **)(*(int *)(this + 0x194) + 0x2c))(this_00,pcVar7);
if ((iVar2 == 0) &&
((*(char **)(this + 0x7c) == "prop_dynamic" ||
(cVar1 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)this,"prop_dynamic"), cVar1 != '\0'))
)) {
CCollisionProperty::SetSolid(this_00,3);
CCollisionProperty::SetSolidFlags(this_00,(uint)(*(ushort *)(this + 0x1b4) | 4));
}
CBreakableProp::Spawn((CBreakableProp *)this);
if (((byte)this[0x14c] & 1) == 0) {
if ((((*(char **)(this + 0x7c) == "dynamic_prop") ||
(cVar1 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)this,"dynamic_prop"),
cVar1 != '\0')) || (*(char **)(this + 0x7c) == "prop_dynamic_override")) ||
(cVar1 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)this,"prop_dynamic_override"),
cVar1 != '\0')) {
CBaseEntity::SetClassname((char *)this);
}
CBaseEntity::AddFlag((CBaseEntity *)this,0x40000);
if ((this[0x158c] != (CDynamicProp)0x0) || (*(int *)(this + 0x1580) != 0)) {
CBaseEntity::RemoveFlag((CBaseEntity *)this,0x40000);
if (this[0x158c] == (CDynamicProp)0x0) {
pcVar7 = "";
if (*(char **)(this + 0x1580) != (char *)0x0) {
pcVar7 = *(char **)(this + 0x1580);
}
PropSetAnim(this,pcVar7);
}
else {
uVar10 = 0;
uVar9 = 0;
uVar8 = 0;
CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)AnimThink);
fVar6 = *(float *)(gpGlobals + 0xc);
lVar5 = (longdouble)
(**(code **)(*random_valve + 4))
(random_valve,*(undefined4 *)(this + 0x1594),
*(undefined4 *)(this + 0x1598),uVar8,uVar9,uVar10);
iVar2 = gpGlobals;
fVar6 = (float)lVar5 + fVar6;
*(float *)(this + 0x1590) = fVar6;
CBaseEntity::SetNextThink
((CBaseEntity *)this,fVar6 + *(float *)(iVar2 + 0xc) + 0.1,(char *)0x0);
}
}
(**(code **)(*(int *)this + 0x290))(this);
BoneFollowerHierarchyChanged(this);
if (this[0x159e] != (CDynamicProp)0x0) {
CBaseEntity::AddEffects((CBaseEntity *)this,0x20);
}
if (this[0x14ac] == (CDynamicProp)0x0) {
CBaseProp::CalculateBlockLOS((CBaseProp *)this);
}
uVar3 = *(uint *)(this + 0x148);
CVar4 = (CDynamicProp)((byte)(uVar3 >> 6) & 1);
if (CVar4 != this[0x15a0]) {
if (this[0x6c] == (CDynamicProp)0x0) {
this_02 = *(CBaseEdict **)(this + 0x30);
if (this_02 != (CBaseEdict *)0x0) {
*(uint *)this_02 = *(uint *)this_02 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(this_02);
*(undefined2 *)(iVar2 + 2) = 0;
uVar3 = *(uint *)(this + 0x148);
}
}
else {
this[0x70] = (CDynamicProp)((byte)this[0x70] | 1);
}
this[0x15a0] = CVar4;
}
if ((uVar3 & 0x100) != 0) {
CCollisionProperty::SetSolidFlags(this_00,(uint)(*(ushort *)(this + 0x1b4) | 4));
}
this_01 = (CGlowProperty *)(this + 0x1f0);
CGlowProperty::SetGlowState(this_01,*(int *)(this + 0x15bc));
CGlowProperty::SetGlowRange(this_01,*(int *)(this + 0x15c0));
CGlowProperty::SetGlowRangeMin(this_01,*(int *)(this + 0x15c4));
CGlowProperty::SetGlowColorOverride(this_01,*(undefined4 *)(this + 0x15c8));
}
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.