drbrain avatar drbrain committed 825b8af

Added check for fake players to flag game shuffler.

Comments (0)

Files changed (1)

hs_py/hs_fg_wz.py

 		# When Flag:ConsecutiveWinsToShuffle is set, this specifies
 		# the highest frequency that will be shuffled.
 		me.maxfreqtoshuffle = cfg.GetInt(c, "Flag", "MaxFreqToShuffle", 1)
+		
+		# cfghelp: Flag:MinFreqToShuffle, arena, int, def: 1
+		# When Flag:ConsecutiveWinsToShuffle is set, this specifies
+		# the lowest frequency that will be shuffled.
+		me.minfreqtoshuffle = cfg.GetInt(c, "Flag", "MinFreqToShuffle", 1)
 
 		# cfghelp: Flag:DisallowFlagTeamStart, arena, int, def: 1
 		# Sets the starting frequency of teams that are not 
 			a.fg_wz_consecutive_wins = 0
 
 		a.fg_wz_consecutive_wins += 1
-		if winfreq <= a.fg_wz_sets.maxfreqtoshuffle:
+		if winfreq <= a.fg_wz_sets.maxfreqtoshuffle and \
+		   winfreq >= a.fg_wz_sets.minfreqtoshuffle:
 			playerlist = []
 			if a.fg_wz_consecutive_wins >= a.fg_wz_sets.consecutivewinstoshuffle:
 				a.fg_wz_last_freq_to_win = -1
 				a.fg_wz_consecutive_wins = 0
 				chat.SendArenaMessage(a, "---SHUFFLING TEAMS---")
 				def playerstolist(p):
-					if p.freq <= a.fg_wz_sets.maxfreqtoshuffle and p.arena == a:
+					if p.freq <= a.fg_wz_sets.maxfreqtoshuffle and \
+					   p.freq >= a.fg_wz_sets.minfreqtoshuffle and \
+					   p.arena == a and p.type != asss.T_FAKE:
 						playerlist.append((p, p.ship))
 						game.SetShipAndFreq(p, asss.SHIP_SPEC, a.specfreq)
 				asss.for_each_player(playerstolist)
 			(ok,f) = flagcore.GetFlags(a, fid)
 			if sets.allowpriv == 0 and ok == 1 and f.carrier.freq >= 100:									
 				spawn(False, False)
-			if ok == 1 and f.carrier.freq >= sets.disallowflagteamstart and f.carrier.freq < sets.disallowflagteamend
+			if ok == 1 and f.carrier.freq >= sets.disallowflagteamstart and f.carrier.freq < sets.disallowflagteamend:
 				spawn(False, False)
 
 		elif reason == asss.CLEANUP_KILL_TK:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.