From 899e02c36a685ffbfdb72ff8aa2a57b46deb6cd8 Mon Sep 17 00:00:00 2001 From: Cai <13110818005@qq.com> Date: Sun, 22 Jun 2025 08:39:13 +0800 Subject: [PATCH] fix(Bouncer): fix bounds checking in `OnPlayerPortalTeleport` (#3127) --- TShockAPI/Bouncer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index 488abe617..769478238 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -2535,8 +2535,8 @@ internal void OnPlayerPortalTeleport(object sender, GetDataHandlers.TeleportThro } //Generic bounds checking, though I'm not sure if anyone would willingly hack themselves outside the map? - if (args.NewPosition.X > Main.maxTilesX || args.NewPosition.X < 0 - || args.NewPosition.Y > Main.maxTilesY || args.NewPosition.Y < 0) + if (args.NewPosition.X > Main.maxTilesX *16 || args.NewPosition.X < 0 + || args.NewPosition.Y > Main.maxTilesY *16 || args.NewPosition.Y < 0) { TShock.Log.ConsoleDebug(GetString("Bouncer / OnPlayerPortalTeleport rejected teleport out of bounds from {0}", args.Player.Name)); args.Handled = true;