Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxthegreat99 committed Aug 31, 2023
1 parent 985668f commit da30072
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion ReportManager/Config.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using System.IO;
using TShockAPI;

Expand Down
8 changes: 7 additions & 1 deletion ReportManager/Subcommands/Report.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void Add(CommandArgs args)
type = ReportType.Transfer;
break;
case "other":
if (args.Parameters.Count < 2 && args.Parameters.Count > 3)
if (args.Parameters.Count < 2 || args.Parameters.Count > 3)
{
args.Player.SendErrorMessage("Invalid syntax. Valid syntax: '/report other \"<reason>\"");
return;
Expand Down Expand Up @@ -119,6 +119,12 @@ public static void MuteAdd(CommandArgs args)
TSPlayer.FindByNameOrID(args.Parameters[1]).FirstOrDefault().Name :
TShock.UserAccounts.GetUserAccountByName(args.Parameters[1]).Name);

if (TShock.Groups.GetGroupByName(TShock.UserAccounts.GetUserAccountByName(args.Parameters[1]).Group).HasPermission(ReportManager.Permissions.staff))
{
args.Player.SendErrorMessage("You cannot report mute another staff member!");
return;
}

Reports.InsertMute(username, duration);
args.Player.SendSuccessMessage("Prohibited {0} from using /report {1}!", username, (seconds == 0 ? "permanently" : $"for {(seconds / 60)} minutes"));

Expand Down

0 comments on commit da30072

Please sign in to comment.