mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Fixed MaxLimit not being properly ignored when set to 0 (#41852)
* Fixed the issue * Remove stray line
This commit is contained in:
parent
679744311e
commit
b8519626ee
1 changed files with 3 additions and 2 deletions
|
|
@ -124,7 +124,7 @@ public sealed partial class RoleLoadout : IEquatable<RoleLoadout>
|
|||
continue;
|
||||
}
|
||||
|
||||
var loadouts = groupLoadouts[..Math.Min(groupLoadouts.Count, groupProto.MaxLimit)];
|
||||
var loadouts = groupProto.MaxLimit > 0 ? groupLoadouts[..Math.Min(groupLoadouts.Count, groupProto.MaxLimit)] : groupLoadouts;
|
||||
|
||||
// Validate first
|
||||
for (var i = loadouts.Count - 1; i >= 0; i--)
|
||||
|
|
@ -297,7 +297,8 @@ public sealed partial class RoleLoadout : IEquatable<RoleLoadout>
|
|||
var groupLoadouts = SelectedLoadouts[selectedGroup];
|
||||
|
||||
// Need to unselect existing ones if we're at or above limit
|
||||
var limit = Math.Max(0, groupLoadouts.Count + 1 - protoManager.Index(selectedGroup).MaxLimit);
|
||||
var groupProto = protoManager.Index(selectedGroup);
|
||||
var limit = groupProto.MaxLimit > 0 ? Math.Max(0, groupLoadouts.Count + 1 - protoManager.Index(selectedGroup).MaxLimit) : 0;
|
||||
|
||||
for (var i = 0; i < groupLoadouts.Count; i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue