Merge pull request #3128 from ACaiCat/fix-portal-rangecheck

fix(Bouncer): fix bounds checking in `OnPlayerPortalTeleport` (#3127)
This commit is contained in:
Chris 2026-01-18 15:56:38 +10:30 committed by GitHub
commit 104253c2ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2564,8 +2564,8 @@ namespace TShockAPI
} }
//Generic bounds checking, though I'm not sure if anyone would willingly hack themselves outside the map? //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 if (args.NewPosition.X > Main.maxTilesX *16 || args.NewPosition.X < 0
|| args.NewPosition.Y > Main.maxTilesY || args.NewPosition.Y < 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)); TShock.Log.ConsoleDebug(GetString("Bouncer / OnPlayerPortalTeleport rejected teleport out of bounds from {0}", args.Player.Name));
args.Handled = true; args.Handled = true;