anchor.diff:  			var/adminsFile = file("config/admins.txt")
   			WRITE_FILE(adminsFile, "###############################################################################################\n# Basically, ckey goes first. Rank goes after the '='                                         #\n# Case is not important for ckey.                                                             #\n# Case IS important for the rank.                                                             #\n# All punctuation (spaces etc) EXCEPT '-', '_' and '@' will be stripped from rank names.      #\n# Ranks can be anything defined in admin_ranks.txt                                            #\n# NOTE: if the rank-name cannot be found in admin_ranks.txt, they will not be adminned! ~Carn #\n# NOTE: syntax was changed to allow hyphenation of ranknames, since spaces are stripped.      #\n###############################################################################################\n\n# DO NOT EDIT THIS FILE DIRECTLY\n# IT IS AUTOMATICALLY GENERATED FROM THE SERVER DATABASE\n")
   
  -			var/lastGroup = 0
  +			var/lastGroup = 1
   			// Write out each admin to the admins file
   			while(query_admin.NextRow())
   				var/name = query_admin.item[1]
  
positive.code: /proc/refresh_admin_files()
  	// Generate the Admins and Admins Ranks config files
  	if(SSdbcore.IsConnected())
  		var/datum/DBQuery/query_ranks = SSdbcore.NewQuery("SELECT `name`, `include`, `exclude`, `edit` FROM `web_groups` ORDER BY `web_groups`.`rank_group` ASC, `web_groups`.`name` DESC")
  		if(query_ranks.Execute())
  			fdel("config/admin_ranks.txt")
  			var/ranksFile = file("config/admin_ranks.txt")
  			WRITE_FILE(ranksFile, "#Admin Rank format is as follows:	\n#	\n#Name = Game Admin	\n#Include = @ ADMIN BAN SOUND	\n#Exclude = FUN	\n#Edit =	\n#	\n#Name will match anything after '=' and must be identical to an admin's rank in admins.txt to be linked but otherwise has no formatting restrictions.	\n#A rank's permissions are defined with keywords that control access to groups of verbs and abilities, they are case-sensitive and separated by a space with no prefix.	\n#To define no permissions for a type, leave it empty.	\n#There are three types of permissions:	\n#Include will give a keyword to a rank.	\n#Exclude removes a keyword and takes precedence over Include.	\n#Edit will allow an admin to edit these permissions on other ranks or change an admin's rank to another if they can edit all the permissions it has.	\n#Edit is only used when SQL-based admin loading is enabled.	\n#If SQL-based admin loading is enabled, ranks and their keywords listed here will be loaded first and override any with the same name loaded from the database.	\n#	\n#The following are valid permission keywords:	\n#ADMIN = general admin tools, verbs etc.	\n#FUN = events, other event-orientated actions. Access to the fun secrets in the secrets panel.	\n#BAN = the ability to ban and unban.	\n#STEALTH = the ability to stealthmin (make yourself appear with a fake name to everyone but other admins.	\n#POSSESS = the ability to possess objects.	\n#POLL = the ability to create in game server polls (requires DB).	\n#BUILD = the ability to use buildmode.	\n#SERVER = the ability to restart the server, change the game mode or force a round to start/end.	\n#DEBUG = debug tools used for diagnosing and fixing problems. It's useful to give this to coders so they can investigate problems on a live server.	\n#VAREDIT = everyone may view viewvars/debugvars/whatever you call it. This keyword allows you to actually EDIT those variables.	\n#PERMISSIONS = allows you to promote and/or demote people.	\n#SOUND = allows you to upload and play SOUND.	\n#SPAWN = mob transformations, spawning of most atoms including mobs (high-risk atoms, e.g. blackholes, will require the +FUN flag too).	\n#AUTOADMIN = admin gains powers upon connect. This defaults to on, you can exclude AUTOADMIN to make a role require using the readmin verb to gain powers (this does not effect the admin's ability to walk past bans or other on-connect limitations like panic bunker or pop limit).	\n#DBRANKS = when sql-based admin loading is enabled, allows for non-temporary changes in the permissions panel to be saved (requires DB).	\n#EVERYTHING = Simply gives you everything without having to type every flag.	\n#@ = special keyword for the current permission type that adds all the keywords that the preceding rank has of the same type.\n\n# DO NOT EDIT THIS FILE DIRECTLY\n# IT IS AUTOMATICALLY GENERATED FROM THE SERVER DATABASE\n")
  
  			// Write out each rank to the rank file
  			while(query_ranks.NextRow())
  				var/rank_name = query_ranks.item[1]
  				var/rank_includes = query_ranks.item[2]
  				var/rank_excludes = query_ranks.item[3]
  				var/rank_edits = query_ranks.item[4]
  				WRITE_FILE(ranksFile, "Name = [rank_name]")
  				WRITE_FILE(ranksFile, "Include = [rank_includes]")
  				WRITE_FILE(ranksFile, "Exclude = [rank_excludes]")
  				WRITE_FILE(ranksFile, "Edit = [rank_edits]")
  				WRITE_FILE(ranksFile, " ")
  
  		qdel(query_ranks)
  
  
negative.code: 					WRITE_FILE(adminsFile, " ")
  				WRITE_FILE(adminsFile, "[name]\t=\t[rank]")
  
  		qdel(query_admin)