Fix dart traps and bathtubs

This commit is contained in:
MarioE 2013-10-03 22:27:45 -04:00
parent 6a2ed7a3ce
commit e4b6f866dd

View file

@ -1605,6 +1605,11 @@ namespace TShockAPI
return false; return false;
} }
/// <summary>
/// Tiles that can be oriented (e.g., beds, chairs, bathtubs, etc).
/// </summary>
private static byte[] orientableTiles = new byte[] { 15, 79, 90, 137 };
private static bool HandleSendTileSquare(GetDataHandlerArgs args) private static bool HandleSendTileSquare(GetDataHandlerArgs args)
{ {
if (args.Player.Group.HasPermission(Permissions.allowclientsideworldedit)) if (args.Player.Group.HasPermission(Permissions.allowclientsideworldedit))
@ -1674,9 +1679,8 @@ namespace TShockAPI
} }
} }
// Chairs and beds // Orientable tiles
if ((tile.type == 15 && newtile.Type == 15) || if (tile.type == newtile.Type && orientableTiles.Contains(tile.type))
(tile.type == 79 && newtile.Type == 79))
{ {
tile.frameX = newtile.FrameX; tile.frameX = newtile.FrameX;
tile.frameY = newtile.FrameY; tile.frameY = newtile.FrameY;