Skip to content

Commit

Permalink
Remove useless error message for exportcharacter
Browse files Browse the repository at this point in the history
  • Loading branch information
sgkoishi committed Dec 19, 2023
1 parent 1d6aec6 commit 76c0e9f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Core/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,6 @@ public enum TitleSuppression
Disabled,
Smart,
Enabled,
False = Disabled,
True = Smart
}
}

Expand Down
13 changes: 13 additions & 0 deletions Core/DebugPacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ private void MMHook_DebugPacket_CatchSend(On.Terraria.NetMessage.orig_SendData o
}
throw;
}
catch (IndexOutOfRangeException ir)
{
if (remoteClient == int.MaxValue)
{
return;
}

if (this.config.DebugPacket.Value.ShowCatchedException > Config.DebugPacketSettings.CatchedException.None)
{
TShockAPI.TShock.Log.ConsoleError($"{ir}");
}
throw;
}
catch (Exception ex)
{
if (this.config.DebugPacket.Value.ShowCatchedException > Config.DebugPacketSettings.CatchedException.None)
Expand Down
4 changes: 3 additions & 1 deletion Core/MiscCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ private void Command_ResetCharacter(CommandArgs args)
private void Command_ExportCharacter(CommandArgs args)
{
var accounts = args.Parameters.Count == 0
? new List<TShockAPI.DB.UserAccount> { args.Player.Account }
? args.Player == TSPlayer.Server
? TShockAPI.TShock.UserAccounts.GetUserAccounts()
: [args.Player.Account]
: Utils.SearchUserAccounts(args.Parameters[0]).ToList();

if (accounts.Count == 0)
Expand Down

0 comments on commit 76c0e9f

Please sign in to comment.