mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Fix character slots that exceed the maximum character limit becoming not deletable (#44558)
Fixed character slots over the MaxCharacterSlots cvar being impossible to delete directly. Also added a check that should prevent a deletion attempt being made on a slot that does not exist.
This commit is contained in:
parent
03a8a2d73d
commit
2e5e53a1b1
1 changed files with 7 additions and 1 deletions
|
|
@ -300,13 +300,19 @@ namespace Content.Server.Preferences.Managers
|
|||
return;
|
||||
}
|
||||
|
||||
if (slot < 0 || slot >= MaxCharacterSlots)
|
||||
|
||||
if (slot < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var curPrefs = prefsData.Prefs!;
|
||||
|
||||
if (!curPrefs.Characters.ContainsKey(slot))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If they try to delete the slot they have selected then we switch to another one.
|
||||
// Of course, that's only if they HAVE another slot.
|
||||
int? nextSlot = null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue