Commits

drbrain committed 8283d9b

Added option to hs_flagprivs to prevent changing on the flagging freqs.

  • Participants
  • Parent commits c22d6e5

Comments (0)

Files changed (1)

File hs_pubarena/hs_flagprivs.c

 	int max_freq;
 	Region *center;
 	int center_limit;
+	int can_change_on_flagging;
 } adata;
 
 //modules
 		}
 		else if (p->p_freq >= ad->priv_freq_start)
 		{
-			int found = 0;
-			Player *i;
-			Link *link;
-			
-			pd->Lock();
-			FOR_EACH_PLAYER(i)
-				if (i != p && i->arena == p->arena && i->p_freq == p->p_freq && IS_HUMAN(i))
+			if (ad->can_change_on_flagging)
+			{
+				int found = 0;
+				Player *i;
+				Link *link;
+
+				pd->Lock();
+				FOR_EACH_PLAYER(i)
+					if (i != p && i->arena == p->arena && i->p_freq == p->p_freq && IS_HUMAN(i))
+					{
+						found = 1;
+						break;
+					}
+				pd->Unlock();
+
+				if (!found)
 				{
-					found = 1;
-					break;
+					if (err_buf)
+					{
+						snprintf(err_buf, buf_len, "Your team needs at least one player.");
+					}
+					return 0;
 				}
-			pd->Unlock();
-
-			if (!found)
+			}
+			else
 			{
-				if (err_buf)
-				{
-					snprintf(err_buf, buf_len, "Your team needs at least one player.");
-				}
 				return 0;
 			}
 		}
 
 	region_name = cfg->GetStr(ch, "Hyperspace", "CenterRegionName");
 
+	ad->can_change_on_flagging = cfg->GetInt(ch, "Hyperspace", "CanChangeOnFlagging", 1);
+
 	if (region_name)
 	{
 		ad->center = mapdata->FindRegionByName(arena, region_name);