Skip to content

Commit 346539b

Browse files
committed
Last dance
1 parent fc1ebde commit 346539b

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,11 @@ private void OnBallisticTakeAmmo(EntityUid uid, BallisticAmmoProviderComponent c
240240
for (var i = 0; i < args.Shots; i++)
241241
{
242242
EntityUid? ammoEntity = null;
243-
244-
var existingEnt = component.Entities[^1];
245-
246243
if (component.Entities.Count > 0)
247244
{
248-
args.Ammo.Add((existingEnt, EnsureShootable(existingEnt)));
249245
if (!component.AutoCycle) //WL - if autocycle=false don't remove spent ammo from the gun
250246
break;
247+
var existingEnt = component.Entities[^1];
251248
component.Entities.RemoveAt(component.Entities.Count - 1);
252249
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
253250
Containers.Remove(existingEnt, component.Container);
@@ -261,8 +258,8 @@ private void OnBallisticTakeAmmo(EntityUid uid, BallisticAmmoProviderComponent c
261258
//WL - if autocycle=false put spent ammo back in the gun
262259
if (!component.AutoCycle)
263260
{
264-
component.Entities.Add(existingEnt);
265-
Containers.Insert(existingEnt, component.Container);
261+
component.Entities.Add(ammoEntity.Value);
262+
Containers.Insert(ammoEntity.Value, component.Container);
266263
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
267264
}
268265
//WL - Autocycle end

Resources/Maps/packed.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12029,19 +12029,19 @@ entities:
1202912029
parent: 2
1203012030
- type: Fixtures
1203112031
fixtures: {}
12032-
- uid: 13173
12033-
components:
12034-
- type: MetaData
12035-
name: APC (Engi - Telecomms)
12036-
- type: Transform
12037-
rot: 3.141592653589793 rad
12038-
pos: 18.5,-20.5
12039-
parent: 2
12040-
- type: AccessReader
12041-
accessListsOriginal:
12042-
- - Engineering
12043-
- type: Fixtures
12044-
fixtures: {}
12032+
# - uid: 13173
12033+
# components:
12034+
# - type: MetaData
12035+
# name: APC (Engi - Telecomms)
12036+
# - type: Transform
12037+
# rot: 3.141592653589793 rad
12038+
# pos: 18.5,-20.5
12039+
# parent: 2
12040+
# - type: AccessReader
12041+
# accessListsOriginal:
12042+
# - - Engineering
12043+
# - type: Fixtures
12044+
# fixtures: {}
1204512045
- uid: 13549
1204612046
components:
1204712047
- type: MetaData

0 commit comments

Comments
 (0)