Skip to content

Commit

Permalink
Фикс русских имен
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh1ntra committed Jun 27, 2024
1 parent 2d1e354 commit dc7b54f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Content.Shared/Preferences/HumanoidCharacterProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public sealed partial class HumanoidCharacterProfile : ICharacterProfile
{
public const int MaxNameLength = 32;
public const int MaxDescLength = 512;
private static readonly Regex RestrictedNameRegex = new("[^А-Яа-яёЁ0-9' -]");

private readonly Dictionary<string, JobPriority> _jobPriorities;
private readonly List<string> _antagPreferences;
Expand Down Expand Up @@ -460,7 +461,7 @@ public void EnsureValid(IConfigurationManager configManager, IPrototypeManager p

if (configManager.GetCVar(CCVars.RestrictedNames))
{
name = Regex.Replace(name, @"[^\u0030-\u0039,\u0041-\u005A,\u0061-\u007A,\u00C0-\u00D6,\u00D8-\u00F6,\u00F8-\u00FF,\u0100-\u017F, '.,-]", string.Empty);
//name = Regex.Replace(name, @"[^\u0030-\u0039,\u0041-\u005A,\u0061-\u007A,\u00C0-\u00D6,\u00D8-\u00F6,\u00F8-\u00FF,\u0100-\u017F, '.,-]", string.Empty);
/*
* 0030-0039 Basic Latin: ASCII Digits
* 0041-005A Basic Latin: Uppercase Latin Alphabet
Expand All @@ -470,6 +471,7 @@ public void EnsureValid(IConfigurationManager configManager, IPrototypeManager p
* 00F8-00FF Latin-1 Supplement: Letters III
* 0100-017F Latin Extended A: European Latin
*/
name = RestrictedNameRegex.Replace(name, string.Empty);
}

if (configManager.GetCVar(CCVars.ICNameCase))
Expand Down
30 changes: 15 additions & 15 deletions Resources/Prototypes/Nuclear14/Catalog/Fills/storage_fills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,12 @@
- id: N14WeaponSniperVarmint
prob: 0.3
orGroup: Weapon
- id: N14WeaponRevolvermagnum
prob: 0.2
orGroup: Weapon
- id: N14Weapon45SMG
prob: 0.2
orGroup: Weapon
# - id: N14WeaponRevolvermagnum
# prob: 0.2
# orGroup: Weapon
# - id: N14Weapon45SMG
# prob: 0.2
# orGroup: Weapon
- id: LongMagazine5.56Rifle
prob: 0.4
orGroup: Weapon
Expand Down Expand Up @@ -822,9 +822,9 @@
- id: N14ClothingMaskDesertMask
prob: 0.2
orGroup: Clothing
- id: N14ClothingHeadHatBaseHelmetMetal
prob: 0.1
orGroup: Clothing
# - id: N14ClothingHeadHatBaseHelmetMetal
# prob: 0.1
# orGroup: Clothing
- id: N14ClothingHeadHatBaseHelmet
prob: 0.1
orGroup: Clothing
Expand Down Expand Up @@ -1096,9 +1096,9 @@
- id: N14WeaponPistolSpy
prob: 0.1
orGroup: Weapon
- id: N14WeaponRevolvermagnum
prob: 0.2
orGroup: Weapon
# - id: N14WeaponRevolvermagnum
# prob: 0.2
# orGroup: Weapon
- id: N14WeaponHunterRevolver
prob: 0.1
orGroup: Weapon
Expand Down Expand Up @@ -1256,9 +1256,9 @@
- id: N14ClothingHeadHatVaultRiot
prob: 0.1
orGroup: Clothing
- id: N14ClothingHeadHatBaseHelmetMetal
prob: 0.1
orGroup: Clothing
# - id: N14ClothingHeadHatBaseHelmetMetal
# prob: 0.1
# orGroup: Clothing
- id: N14ClothingHeadHatBaseHelmet
prob: 0.1
orGroup: Clothing
Expand Down

0 comments on commit dc7b54f

Please sign in to comment.