Skip to content

Commit

Permalink
Revolver fix (again) (space-wizards#8635)
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth authored and EmoGarbage404 committed Jun 5, 2022
1 parent 354ad84 commit 209367a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,8 @@ private void OnRevolverHandleState(EntityUid uid, RevolverAmmoProviderComponent

var oldIndex = component.CurrentIndex;
component.CurrentIndex = state.CurrentIndex;

component.AmmoSlots.EnsureCapacity(state.AmmoSlots.Count);
component.AmmoSlots.Clear();
component.Chambers = new bool?[state.Chambers.Length];

DebugTools.Assert(component.AmmoSlots.Count == component.Chambers.Length);

// Need to copy across the state rather than the ref.
for (var i = 0; i < component.AmmoSlots.Count; i++)
{
Expand Down Expand Up @@ -322,6 +317,8 @@ private void OnRevolverInit(EntityUid uid, RevolverAmmoProviderComponent compone
component.Chambers[i] = true;
}
}

DebugTools.Assert(component.AmmoSlots.Count == component.Capacity);
}

[Serializable, NetSerializable]
Expand Down
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/weapons/ranged/gun.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ gun-magazine-examine = It has [color={$color}]{$count}[/color] shots remaining.
# RevolverAmmoProvider
gun-revolver-empty = Empty revolver
gun-revolver-full = Revolver full
gun-revolver-insert = Insert
gun-revolver-insert = Inserted
gun-revolver-spin = Spin revolver
gun-revolver-spun = Spun

0 comments on commit 209367a

Please sign in to comment.