]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/vote.qc
Limit maximum length of vote commands to 160 by default
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qc
index 125182c8a78e3f31dfbf9f0466e6aaf5bd54c931..c7010dfb756369a47cd41aff93425d567d69bfc4 100644 (file)
@@ -330,9 +330,6 @@ void reset_map(float dorespawn)
                race_ReadyRestart();
        else MUTATOR_CALLHOOK(reset_map_global);
 
-       lms_lowest_lives = 999;
-       lms_next_place = player_count;
-
        for(self = world; (self = nextent(self)); )
        if(IS_NOT_A_CLIENT(self))
        {
@@ -377,8 +374,6 @@ void reset_map(float dorespawn)
                        //NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players
                        if (IS_PLAYER(self)) {
                                //PlayerScore_Clear(self);
-                               if(g_lms)
-                                       PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
                                self.killcount = 0;
                                //stop the player from moving so that he stands still once he gets respawned
                                self.velocity = '0 0 0';
@@ -673,6 +668,18 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl
        
        first_command = argv(startpos);
 
+       /*dprint(sprintf("VoteCommand_parse(): Command: '%s', Length: %f.\n",
+               substring(vote_command, argv_start_index(startpos), strlen(vote_command) - argv_start_index(startpos)),
+               strlen(substring(vote_command, argv_start_index(startpos), strlen(vote_command) - argv_start_index(startpos)))
+       ));*/
+
+       if(
+               (autocvar_sv_vote_limit > 0)
+               &&
+               (strlen(substring(vote_command, argv_start_index(startpos), strlen(vote_command) - argv_start_index(startpos))) > autocvar_sv_vote_limit)
+       )
+               return FALSE;
+
        if not(VoteCommand_checkinlist(first_command, vote_list))
                return FALSE;
 
@@ -1072,8 +1079,8 @@ void VoteCommand_(float request)
 void VoteCommand_macro_help(entity caller, float argc)
 {
        string command_origin = GetCommandPrefix(caller);
-       
-       if(argc == 2) // help display listing all commands
+
+       if(argc == 2 || argv(2) == "help") // help display listing all commands
        {
                print_to(caller, "\nVoting commands:\n");
                #define VOTE_COMMAND(name,function,description,assignment) \