Browse Source

Removed unprintable to space conversion

Would be a lot more work to check for the last character (since you do
have no iterate through the entire name for multi-bytes), and who cares
how mangled the names of *these kinds of people* are anyways?
nosoop 7 years ago
parent
commit
9d05b5be13
1 changed files with 3 additions and 7 deletions
  1. 3 7
      scripting/csrd_name_filter.sp

+ 3 - 7
scripting/csrd_name_filter.sp

@@ -15,7 +15,7 @@
 
 #pragma newdecls required
 
-#define PLUGIN_VERSION "1.0.3"
+#define PLUGIN_VERSION "1.0.4"
 public Plugin myinfo = {
 	name = "[CSRD] Name Filter",
 	author = "nosoop",
@@ -83,12 +83,6 @@ void OnNameUpdated(int client) {
 		if (!bCharFiltered) {
 			// it's a character we're not filtering
 			StrCatMultiByteChar(newNameBuffer, sizeof(newNameBuffer), fullChar, nCharBytes);
-		} else {
-			// we filtered this one
-			// we could be as rude as they are in using unprintables, but we're nice
-			
-			// TODO check if the last character in new buffer is a space to prevent multiples
-			StrCat(newNameBuffer, sizeof(newNameBuffer), " ");
 		}
 		
 		bNameChanged |= bCharFiltered;
@@ -100,6 +94,8 @@ void OnNameUpdated(int client) {
 		// Remove surrounding whitespace
 		TrimString(newNameBuffer);
 		
+		// TODO remove duplicate whitespace
+		
 		// If there's no printable characters in the buffer, the player is a total dongbus.
 		if (strlen(newNameBuffer) == 0) {
 			Format(newNameBuffer, sizeof(newNameBuffer), UNPRINTABLE_NAME_USER_FORMAT,