L L4D2node

CPropMountedGun::Spawn

0x0054ddc0 · 1566 bytes · __thiscall

_ZN15CPropMountedGun5SpawnEv

Decompiled

undefined (1 param)

/* CPropMountedGun::Spawn() */

void __thiscall CPropMountedGun::Spawn(CPropMountedGun *this)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  CBaseEntity *this_00;
  int iVar3;
  undefined *puVar4;
  longdouble lVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  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);
  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] == (CPropMountedGun)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] = (CPropMountedGun)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x15cc) = 0xffffffff;
  }
  CBaseEntity::SetClassname((char *)this);
  (**(code **)(*(int *)this + 0x70))(this,"models/w_models/weapons/50cal.mdl");
  CBaseEntity::SetGlobalFadeScale((CBaseEntity *)this,0.0);
  *(char **)(this + 0x1610) = "AMMO_TYPE_MINIGUN";
  *(undefined4 *)(this + 0x15fc) = 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);
  }
  fVar7 = *(float *)(this + 0x37c);
  if (((fVar7 != *(float *)(this + 0x15e4)) ||
      (fVar8 = *(float *)(this + 0x380), fVar8 != *(float *)(this + 0x15e8))) ||
     (fVar6 = *(float *)(this + 0x15ec), fVar6 != *(float *)(this + 900))) {
    if (this[0x6c] == (CPropMountedGun)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
        fVar7 = *(float *)(this + 0x37c);
      }
    }
    else {
      this[0x70] = (CPropMountedGun)((byte)this[0x70] | 1);
    }
    fVar8 = *(float *)(this + 0x380);
    *(float *)(this + 0x15e4) = fVar7;
    fVar6 = *(float *)(this + 900);
    *(float *)(this + 0x15e8) = fVar8;
    *(float *)(this + 0x15ec) = fVar6;
  }
  uVar1 = *(uint *)(this + 0x180);
  *(float *)(this + 0x15f0) = fVar7;
  *(float *)(this + 0x15f4) = fVar8;
  puVar4 = g_pEntityList;
  *(float *)(this + 0x15f8) = fVar6;
  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 + 0x1600) = *(undefined4 *)(gpGlobals + 0xc);
  if ((*(float *)(this + 0x15d8) == 0.0) && (fVar7 = *(float *)(this + 0x15d4), -fVar7 != 0.0)) {
    if (this[0x6c] == (CPropMountedGun)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] = (CPropMountedGun)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x15d8) = -fVar7;
  }
  fVar6 = 0.0;
  fVar7 = *(float *)(this + 0x15d0);
  fVar8 = fVar7;
  if (fVar7 <= 0.0) {
    fVar8 = fVar6;
  }
  if (90.0 <= fVar8) {
    fVar8 = 90.0;
  }
  if (fVar7 != fVar8) {
    if (this[0x6c] == (CPropMountedGun)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] = (CPropMountedGun)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x15d0) = fVar8;
  }
  fVar7 = *(float *)(this + 0x15d4);
  fVar8 = fVar7;
  if (fVar7 <= 0.0) {
    fVar8 = fVar6;
  }
  if (60.0 <= fVar8) {
    fVar8 = 60.0;
  }
  if (fVar7 != fVar8) {
    if (this[0x6c] == (CPropMountedGun)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] = (CPropMountedGun)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x15d4) = fVar8;
  }
  fVar7 = *(float *)(this + 0x15d8);
  fVar8 = -30.0;
  if (-30.0 <= fVar7) {
    fVar8 = fVar7;
  }
  if (0.0 <= fVar8) {
    fVar8 = fVar6;
  }
  if (fVar7 != fVar8) {
    if (this[0x6c] == (CPropMountedGun)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] = (CPropMountedGun)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x15d8) = fVar8;
  }
  if (this[0x15dc] != (CPropMountedGun)0x0) {
    if (this[0x6c] == (CPropMountedGun)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] = (CPropMountedGun)((byte)this[0x70] | 1);
    }
    this[0x15dc] = (CPropMountedGun)0x0;
  }
  if (this[0x15dd] != (CPropMountedGun)0x0) {
    if (this[0x6c] == (CPropMountedGun)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] = (CPropMountedGun)((byte)this[0x70] | 1);
    }
    this[0x15dd] = (CPropMountedGun)0x0;
  }
  if (*(float *)(this + 0x15e0) != 0.0) {
    if (this[0x6c] == (CPropMountedGun)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] = (CPropMountedGun)((byte)this[0x70] | 1);
      *(undefined4 *)(this + 0x15e0) = 0;
    }
  }
  VisibilityMonitor_AddEntity
            ((CBaseEntity *)this,360.0,(_func_bool_CBaseEntity_ptr_CBasePlayer_ptr *)0x0,
             (_func_bool_CBaseEntity_ptr_CBasePlayer_ptr *)0x0);
  lVar5 = (longdouble)CountdownTimer::Now();
  fVar7 = *(float *)(this + 0x1628);
  if ((float)lVar5 + fVar7 != *(float *)(this + 0x162c)) {
    (**(code **)(*(int *)(this + 0x1624) + 4))(this + 0x1624,this + 0x162c);
    *(float *)(this + 0x162c) = (float)lVar5 + fVar7;
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)