Add default ammo for guns (#1207)

* Add default ammo types

* Add revolver and bolt action default pro support

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-06-25 01:29:40 +10:00
committed by GitHub
parent f6da38ccb9
commit 63f2724341
11 changed files with 71 additions and 6 deletions

View File

@@ -110,7 +110,13 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{
if (_fillPrototype != null)
{
_unspawnedCount += Capacity - 1;
_unspawnedCount += Capacity;
if (_unspawnedCount > 0)
{
_unspawnedCount--;
var chamberEntity = Owner.EntityManager.SpawnEntity(_fillPrototype, Owner.Transform.GridPosition);
_chamberContainer.Insert(chamberEntity);
}
}
UpdateAppearance();
}
@@ -139,6 +145,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
}
_appearanceComponent?.SetData(MagazineBarrelVisuals.MagLoaded, true);
Dirty();
UpdateAppearance();
}