Skip to content

Commit

Permalink
Team Command Existing Team Check
Browse files Browse the repository at this point in the history
- Checks if they're trying to switch to the same team they're on now
  • Loading branch information
data-bomb committed Jun 22, 2024
1 parent 3a01e11 commit 9ec713a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Si_BasicTeamBalance/Si_BasicTeamBalance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You should have received a copy of the GNU General Public License
using SilicaAdminMod;
using System.Linq;

[assembly: MelonInfo(typeof(BasicTeamBalance), "Basic Team Balance", "1.3.1", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonInfo(typeof(BasicTeamBalance), "Basic Team Balance", "1.3.2", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonGame("Bohemia Interactive", "Silica")]
[assembly: MelonOptionalDependencies("Admin Mod")]

Expand Down Expand Up @@ -304,6 +304,14 @@ public static void Command_Team(Player? callerPlayer, String args)
return;
}

// check if they're already on the target team
if (player.Team == team)
{
HelperMethods.SendChatMessageToPlayer(callerPlayer, HelperMethods.chatPrefix, commandName, ": Player already on target team");
return;
}

// swap and notify players
SwapTeam(player, team);
HelperMethods.AlertAdminAction(callerPlayer, "swapped " + player.PlayerName + " to " + HelperMethods.GetTeamColor(player) + team.TeamShortName);
}
Expand Down

0 comments on commit 9ec713a

Please sign in to comment.