Last dance

This commit is contained in:
Charlotte Tezuka
2026-01-17 20:57:48 +02:00
parent fc1ebde212
commit 346539ba44
2 changed files with 16 additions and 19 deletions

View File

@@ -240,14 +240,11 @@ public abstract partial class SharedGunSystem
for (var i = 0; i < args.Shots; i++)
{
EntityUid? ammoEntity = null;
var existingEnt = component.Entities[^1];
if (component.Entities.Count > 0)
{
args.Ammo.Add((existingEnt, EnsureShootable(existingEnt)));
if (!component.AutoCycle) //WL - if autocycle=false don't remove spent ammo from the gun
break;
var existingEnt = component.Entities[^1];
component.Entities.RemoveAt(component.Entities.Count - 1);
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
Containers.Remove(existingEnt, component.Container);
@@ -261,8 +258,8 @@ public abstract partial class SharedGunSystem
//WL - if autocycle=false put spent ammo back in the gun
if (!component.AutoCycle)
{
component.Entities.Add(existingEnt);
Containers.Insert(existingEnt, component.Container);
component.Entities.Add(ammoEntity.Value);
Containers.Insert(ammoEntity.Value, component.Container);
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
}
//WL - Autocycle end

View File

@@ -12029,19 +12029,19 @@ entities:
parent: 2
- type: Fixtures
fixtures: {}
- uid: 13173
components:
- type: MetaData
name: APC (Engi - Telecomms)
- type: Transform
rot: 3.141592653589793 rad
pos: 18.5,-20.5
parent: 2
- type: AccessReader
accessListsOriginal:
- - Engineering
- type: Fixtures
fixtures: {}
# - uid: 13173
# components:
# - type: MetaData
# name: APC (Engi - Telecomms)
# - type: Transform
# rot: 3.141592653589793 rad
# pos: 18.5,-20.5
# parent: 2
# - type: AccessReader
# accessListsOriginal:
# - - Engineering
# - type: Fixtures
# fixtures: {}
- uid: 13549
components:
- type: MetaData