CPropMinigun::Spawn
0x00548000 · 1467 bytes · __thiscall
_ZN12CPropMinigun5SpawnEv
Decompiled
undefined (1 param)
/* CPropMinigun::Spawn() */
void __thiscall CPropMinigun::Spawn(CPropMinigun *this)
{
uint uVar1;
CBaseEdict *pCVar2;
CBaseEntity *this_00;
int iVar3;
undefined *puVar4;
float fVar5;
float fVar6;
float fVar7;
undefined1 local_34 [16];
undefined4 local_24;
undefined4 local_20;
undefined4 local_1c;
undefined4 local_18;
undefined4 local_14;
undefined4 local_10;
(**(code **)(*(int *)this + 0x6c))(this);
CDynamicProp::Spawn((CDynamicProp *)this);
CBaseEntity::SetClassname((char *)this);
uVar1 = *(uint *)(this + 0x15cc);
if ((((uVar1 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x15cc) = 0xffffffff;
}
CBaseEntity::SetGlobalFadeScale((CBaseEntity *)this,0.0);
*(char **)(this + 0x161c) = "AMMO_TYPE_MINIGUN";
*(undefined4 *)(this + 0x15fc) = 0;
*(undefined4 *)(this + 0x1600) = 0;
*(undefined4 *)(this + 0x1604) = 0;
*(undefined4 *)(this + 0x1608) = 0;
CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),2);
local_18 = 0x41200000;
local_14 = 0x41200000;
local_10 = 0x42480000;
local_24 = 0xc1200000;
local_20 = 0xc1200000;
local_1c = 0;
CBaseEntity::SetSize((CBaseEntity *)this,(Vector *)&local_24,(Vector *)&local_18);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
fVar6 = *(float *)(this + 0x37c);
if (((fVar6 != *(float *)(this + 0x15e4)) ||
(fVar7 = *(float *)(this + 0x380), fVar7 != *(float *)(this + 0x15e8))) ||
(fVar5 = *(float *)(this + 0x15ec), fVar5 != *(float *)(this + 900))) {
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
fVar6 = *(float *)(this + 0x37c);
}
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
}
fVar7 = *(float *)(this + 0x380);
*(float *)(this + 0x15e4) = fVar6;
fVar5 = *(float *)(this + 900);
*(float *)(this + 0x15e8) = fVar7;
*(float *)(this + 0x15ec) = fVar5;
}
uVar1 = *(uint *)(this + 0x180);
*(float *)(this + 0x15f0) = fVar6;
*(float *)(this + 0x15f4) = fVar7;
puVar4 = g_pEntityList;
*(float *)(this + 0x15f8) = fVar5;
if (((uVar1 != 0xffffffff) &&
(puVar4 = puVar4 + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar4 + 8) == uVar1 >> 0xc &&
(this_00 = *(CBaseEntity **)(puVar4 + 4), this_00 != (CBaseEntity *)0x0)))) {
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
*(undefined4 *)(this + 0x15f0) = *(undefined4 *)(this_00 + 0x37c);
*(undefined4 *)(this + 0x15f4) = *(undefined4 *)(this_00 + 0x380);
*(undefined4 *)(this + 0x15f8) = *(undefined4 *)(this_00 + 900);
}
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
CBaseEntity::ThinkSet((_func_void *)local_34,(float)this,(char *)AngleThink);
*(undefined4 *)(this + 0x160c) = *(undefined4 *)(gpGlobals + 0xc);
if ((*(float *)(this + 0x15d8) == 0.0) && (fVar6 = *(float *)(this + 0x15d4), -fVar6 != 0.0)) {
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
}
*(float *)(this + 0x15d8) = -fVar6;
}
fVar5 = 0.0;
fVar6 = *(float *)(this + 0x15d0);
fVar7 = fVar6;
if (fVar6 <= 0.0) {
fVar7 = fVar5;
}
if (90.0 <= fVar7) {
fVar7 = 90.0;
}
if (fVar6 != fVar7) {
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
}
*(float *)(this + 0x15d0) = fVar7;
}
fVar6 = *(float *)(this + 0x15d4);
fVar7 = fVar6;
if (fVar6 <= 0.0) {
fVar7 = fVar5;
}
if (60.0 <= fVar7) {
fVar7 = 60.0;
}
if (fVar6 != fVar7) {
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
}
*(float *)(this + 0x15d4) = fVar7;
}
fVar6 = *(float *)(this + 0x15d8);
fVar7 = -30.0;
if (-30.0 <= fVar6) {
fVar7 = fVar6;
}
if (0.0 <= fVar7) {
fVar7 = fVar5;
}
if (fVar6 != fVar7) {
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
}
*(float *)(this + 0x15d8) = fVar7;
}
if (this[0x15dc] != (CPropMinigun)0x0) {
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
}
this[0x15dc] = (CPropMinigun)0x0;
}
if (this[0x15dd] != (CPropMinigun)0x0) {
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
}
this[0x15dd] = (CPropMinigun)0x0;
}
if (*(float *)(this + 0x15e0) == 0.0) {
return;
}
if (this[0x6c] == (CPropMinigun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
*(undefined4 *)(this + 0x15e0) = 0;
}
else {
this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
*(undefined4 *)(this + 0x15e0) = 0;
}
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.