Browse Source

Allow full 31-character names

nosoop 6 years ago
parent
commit
ab05c537ab
1 changed files with 6 additions and 9 deletions
  1. 6 9
      scripting/botmanager.sp

+ 6 - 9
scripting/botmanager.sp

@@ -5,7 +5,7 @@
 #include <tf2>
 #include <tf2_stocks>
 
-#define PLUGIN_VERSION			"1.2.1"
+#define PLUGIN_VERSION			"1.2.2"
 
 public Plugin:myinfo = {
 	name		= "[TF2] Bot Manager",
@@ -28,11 +28,6 @@ new Handle:joiningBots;
 new Handle:fwdBotAdd;
 new Handle:fwdBotKick;
 
-#define UPDATE_FILE		"botmanager.txt"
-#define CONVAR_PREFIX	"bot_manager"
-
-#include "mckayupdater.sp"
-
 public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max) {
 	decl String:game[64];
 	GetGameFolderName(game, sizeof(game));
@@ -235,12 +230,14 @@ AddBot() {
 		default: Format(strClass, sizeof(strClass), "");
 	}
 	
+	char quotedName[MAX_NAME_LENGTH + 2];
+	
 	ReplaceString(name, sizeof(name), "\"", "");
-	if(strlen(name) > 0) {
-		Format(name, sizeof(name), "\"%s\"", name);
+	if (strlen(name)) {
+		Format(quotedName, sizeof(quotedName), "\"%s\"", name);
 	}
 	
-	ServerCommand("tf_bot_add %s %s %s %s", strDifficulty, strTeam, strClass, name); // count class team difficulty name (any order)
+	ServerCommand("tf_bot_add %s %s %s %s", strDifficulty, strTeam, strClass, quotedName); // count class team difficulty name (any order)
 }
 
 GetClassCounts(TFTeam:team, &scout, &soldier, &pyro, &demoman, &heavy, &engineer, &medic, &sniper, &spy) {