Commits

Teemu Piippo committed 512772d

minor update

Comments (0)

Files changed (1)

  * 2. Redistributions in binary form must reproduce the above copyright notice,
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 3. Neither the name of the development team nor the names of its
+ * 3. Neither the name of the Skulltag Development Team nor the names of its
  *    contributors may be used to endorse or promote products derived from this
  *    software without specific prior written permission.
  * 4. Redistributions in any form must be accompanied by information on how to
 			}
 		}
 		
-		// Make a new sv_notypevote for this vote type
-		if (type.forbidCVar.IsEmpty ()) { // Generate one if not given
+		// Generate the forbid CVar name if it's not given
+		if (type.forbidCVar.IsEmpty ()) {
 			type.forbidCVar.Format ("sv_no%svote", type.name.GetChars());
 			type.autogenForbidCVar = true;
 		}
 		
+		// If the CVar does not exist, create it now.
 		if (!FindCVar (type.forbidCVar, NULL)) {
 			FBoolCVar* var = new FBoolCVar (type.forbidCVar, false, CVAR_AUTO | CVAR_ARCHIVE);
 			var->SetArchiveBit ();
 		}
 		
-		// VOTEDEFS_VerifyCommand (type);
 		g_VoteDefs.Push (type);
 	}
 }
 	}
 	
 	Printf ("%s", msg.GetChars());
-}
-
-#if 0
-void VOTEDEFS_VerifyCommand (votetype_t type) {
-	FScanner sc;
-	FString word;
-	
-	// Count number of parameters
-	unsigned parmCount = votedefs_TypeParmCount (type);
-	
-	Printf ("vote type `%s` has %u parameters\n", type.name.GetChars (), parmCount);
-	
-	// If there is no command string, the name is the command alone.
-	// In that case there may not be any parameters.
-	if (type.command.IsEmpty() && parmCount > 0)
-		sc.ScriptError ("vote type `%s` has parameters given with no command string", type.name.GetChars ());
-	
-	bool verified[MAX_VOTEDEF_PARMS];
-	
-	sc.OpenMem ("VOTEDEFS command string", type.command.GetChars(), type.command.Len());
-	sc.SetCMode (true);
-	while (sc.GetToken ()) {
-		FString word = sc.String;
-		
-		// Variable checks... eugh
-		if (word[0] == '%') { // %0 - like variable
-			unsigned varnum = word[1] - '0' - 1; // vars are 1-based, %0 is command name
-			Printf ("variable number: %d\n", varnum);
-			
-			if (varnum >= parmCount)
-				sc.ScriptError ("Parameter %%%d of `%s` is not defined in the parms list", varnum, type.name.GetChars());
-			
-			int vartype = type.parmTypes[varnum];
-			Printf ("variable type: %d\n", vartype);
-			
-			if (vartype >= VOTEPARM_END)
-				sc.ScriptError ("Parameter %%%d of `%s` does not have a valid type", varnum, type.name.GetChars());
-			
-			int numTypeMembers = g_VoteDefMembers[vartype].Size();
-			Printf ("variable type \"%s\" has %d members\n", g_VoteDefParms[vartype], numTypeMembers);
-			
-			// Check members and their validity (like %0.ip for IP for the first variable)
-			if (word.Len () >= 3) {
-				if (word[2] != '.')
-					sc.ScriptError ("badly-formed variable `%s`\n", word.GetChars());
-				
-				// Check that this variable type actually has members
-				if (!numTypeMembers)
-					sc.ScriptError ("variable type \"%s\" has no members", g_VoteDefParms[vartype]);
-				
-				FString member = word.Right (word.Len () - 3);
-				
-				// Check that this variable type has this specified member
-				int j;
-				for (j = 0; j < numTypeMembers; j++) {
-					if (!member.CompareNoCase (g_VoteDefMembers[vartype][j]))
-						break;
-				}
-				
-				if (j == numTypeMembers) // couldn't find it
-					sc.ScriptError ("variable type \"%s\" doesn't have member \"%s\"",
-						g_VoteDefParms[vartype], member.GetChars());
-				
-				verified[varnum] = true;
-			} else if (numTypeMembers) {
-				// the var type has members and we're not specifying which one to use.
-				sc.ScriptError ("variable type \"%s\" needs to be specified a member for",
-					g_VoteDefParms[vartype]);
-			}
-		}
-		
-		word = "";
-	}
-}
-#endif
+}