Пример #1
0
qboolean _CheckConfigVotes (void)
{
	if (_iCheckConfigVotes () == true)
	{
		gi.bprintf (PRINT_HIGH, "More than %i%% config votes reached.\n",
			(int) cvote_pass->value);
		return true;
	}
	return false;
}
Пример #2
0
void
_ConfigExitLevel (char *NextMap)
{
  configlist_t *voteconfig = NULL;
  char buf[MAX_STR_LEN];

  if (_iCheckConfigVotes ())
    {
      voteconfig = ConfigWithMostVotes (NULL);
      gi.bprintf (PRINT_HIGH, "A new config was voted on and is %s.\n",
		  voteconfig->configname);
      Com_sprintf (buf, sizeof (buf), "exec \"mode_%s.cfg\"\n",
		   voteconfig->configname);

      //clear stats
      for (voteconfig = config_votes; voteconfig != NULL;
	   voteconfig = voteconfig->next)
	{
	  voteconfig->num_votes = 0;
	}

      //clear stats
      config_num_votes = 0;
      config_num_clients = 0;
      config_need_to_check_votes = true;
      gi.AddCommandString (buf);
    }
  else
    {
      //clear stats
      for (voteconfig = config_votes; voteconfig != NULL;
	   voteconfig = voteconfig->next)
	{
	  voteconfig->num_votes = 0;
	}

      //clear stats
      config_num_votes = 0;
      config_num_clients = 0;
      config_need_to_check_votes = true;
    }

}