private void Init() { if (MagInternal) { //automatic ejection always disabled SmartGun = false; //populate with a full internal mag on spawn Logger.LogTraceFormat("Auto-populate internal magazine for {0}", Category.Inventory, name); //Make generic magazine and modify it to fit weapon GameObject ammoPrefab = AmmoPrefabs.GetAmmoPrefab(AmmoType.Internal); Inventory.ServerAdd(Spawn.ServerPrefab(ammoPrefab).GameObject, magSlot); CurrentMagazine.ChangeSize(MagSize); CurrentMagazine.ammoType = ammoType; if (isServer) { CurrentMagazine.ServerSetAmmoRemains(MagSize); } } else { //populate with a full external mag on spawn Logger.LogTraceFormat("Auto-populate external magazine for {0}", Category.Inventory, name); //AmmoPrefabs GameObject ammoPrefab = AmmoPrefabs.GetAmmoPrefab(ammoType); Inventory.ServerAdd(Spawn.ServerPrefab(ammoPrefab).GameObject, magSlot); } }
private void Init() { //populate with a full mag on spawn Logger.LogTraceFormat("Auto-populate magazine for {0}", Category.Inventory, name); //AmmoPrefabs GameObject ammoPrefab = AmmoPrefabs.GetAmmoPrefab(ammoType); Inventory.ServerAdd(Spawn.ServerPrefab(ammoPrefab).GameObject, magSlot); }