Fix warp send nullcheck

@punchready reported that there was an issue with the /warp send command
checking for position != (0,0). I tried to figure out what was going on
here, and I came up dry. I think this is vestigial from some other
database or file format storage. When @MarioE converted everything to
the new warp system, he preserved the check. The problem is that the
check seems to be based on the idea that a non-existent warp would
return the default constructor (which would contain Point.Zero).
Instead, a warp not found returns a null now.

Therefore, the proper thing to do, as implied by @punchready, is to
simply nullcheck this value instead.
This commit is contained in:
Lucas Nicodemus 2021-06-13 00:14:32 -07:00
parent eba106a6da
commit 25a7e9e83a
2 changed files with 2 additions and 1 deletions

View file

@ -3137,7 +3137,7 @@ namespace TShockAPI
string warpName = args.Parameters[2];
var warp = TShock.Warps.Find(warpName);
var plr = foundplr[0];
if (warp.Position != Point.Zero)
if (warp != null)
{
if (plr.Teleport(warp.Position.X * 16, warp.Position.Y * 16))
{