i hope fixed (#80)

This commit is contained in:
Valtos
2023-05-19 18:36:51 +07:00
committed by Aviu00
parent 1fae101454
commit 5f07a0d72e

View File

@@ -238,7 +238,11 @@ namespace Content.Server.Preferences.Managers
{
var maxSlots = _cfg.GetCVar(CCVars.GameMaxCharacterSlots);
var extraSlots = _sponsors.TryGetInfo(userId, out var sponsor) ? sponsor.ExtraSlots : 0;
var maxSavedSlots = _cachedPlayerPrefs[userId].Prefs!.Characters.Count;
var maxSavedSlots = 1;
if (_cachedPlayerPrefs.TryGetValue(userId, out var pref))
{
maxSavedSlots = pref.Prefs!.Characters.Count;
}
return Math.Max(maxSlots + extraSlots, maxSavedSlots - 1);
}