HumanoidCharacterProfile and IdCardConsoleComponent constants moved to cvar. Sync id card length with character name length (#35407)
* commit * mark TODOs * compiles * cleanup * cleanup * oops * changed my mind * requested changes * genpop fix
This commit is contained in:
@@ -2,7 +2,9 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Mind.Commands;
|
||||
@@ -10,6 +12,7 @@ namespace Content.Server.Mind.Commands;
|
||||
[AdminCommand(AdminFlags.VarEdit)]
|
||||
public sealed class RenameCommand : LocalizedEntityCommands
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _cfgManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
|
||||
@@ -25,7 +28,7 @@ public sealed class RenameCommand : LocalizedEntityCommands
|
||||
}
|
||||
|
||||
var name = args[1];
|
||||
if (name.Length > IdCardConsoleComponent.MaxFullNameLength)
|
||||
if (name.Length > _cfgManager.GetCVar(CCVars.MaxNameLength))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("cmd-rename-too-long"));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user