]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Correct mobster suffix (#33240)
authorPreston Smith <92108534+thetolbean@users.noreply.github.com>
Sat, 19 Apr 2025 00:33:14 +0000 (19:33 -0500)
committerGitHub <noreply@github.com>
Sat, 19 Apr 2025 00:33:14 +0000 (20:33 -0400)
Correct mob grammar

Content.Server/Speech/EntitySystems/MobsterAccentSystem.cs

index 0e9b0a34ef2797567f784d9143c58db16d66d5fa..5906bf3ed492e5380d9091d8b0521884d8707120 100644 (file)
@@ -14,7 +14,7 @@ public sealed class MobsterAccentSystem : EntitySystem
     private static readonly Regex RegexUpperAr = new(@"(?<=\w)A[Rr](?=\w)");
     private static readonly Regex RegexFirstWord = new(@"^(\S+)");
     private static readonly Regex RegexLastWord = new(@"(\S+)$");
-
+    private static readonly Regex RegexLastPunctuation = new(@"([.!?]+$)(?!.*[.!?])|(?<![.!?])$");
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly ReplacementAccentSystem _replacement = default!;
 
@@ -84,7 +84,7 @@ public sealed class MobsterAccentSystem : EntitySystem
             }
             if (lastWordAllCaps)
                 suffix = suffix.ToUpper();
-            msg += suffix;
+            msg = RegexLastPunctuation.Replace(msg, suffix);
         }
 
         return msg;