diff --git a/CHANGELOG.md b/CHANGELOG.md index 246db4f5..c9369eea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed torchgod settings to include whether or not torchgod has been fought by the player before and respect `usingBiomeTorches` setting. (@Quinci135) * Fixed /worldmode not synchronising data to players after updating the world state (@bartico6, @Arthri) * Added `OnSendNetData` hook to TSAPI, which enables developers to intercept traffic being sent from the server to clients. (@Stealownz) +* Changed `TSPlayer.FindByNameOrID` so that it will continue searching for players and return a list of many players whem ambiguous matches exist in all cases. Specifically, this avoids a scenario where a griefer names themselves `1` and is difficult to enact justice on, because their name will not be found by the matching system used to kick players. (@hakusaro, @Onusai) ## TShock 4.5.3 * Added permissions for using Teleportation Potions, Magic Conch, and Demon Conch. (@drunderscore) diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 8b20dfd3..12fb2d69 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -92,7 +92,7 @@ namespace TShockAPI TSPlayer player = TShock.Players[plrID]; if (player != null && player.Active) { - return new List { player }; + found.Add(player); } } @@ -101,9 +101,6 @@ namespace TShockAPI { if (player != null) { - // Must be an EXACT match - if (player.Name == plr) - return new List { player }; if (player.Name.ToLower().StartsWith(plrLower)) found.Add(player); }