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:
parent
eba106a6da
commit
25a7e9e83a
2 changed files with 2 additions and 1 deletions
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue