Skip to content

Commit

Permalink
Merge pull request #940 from enigmaquip/master
Browse files Browse the repository at this point in the history
Fix Clipboard Bug
  • Loading branch information
enigmaquip authored Dec 7, 2016
2 parents 5868d61 + d9df9d1 commit f26c4e4
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions TEditXna/Editor/Clipboard/ClipboardManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,41 +114,53 @@ public ClipboardBuffer GetSelectionBuffer()
{
if (buffer.GetChestAtTile(x, y, curTile.Type) == null)
{
var data = world.GetChestAtTile(x + area.X, y + area.Y);
if (data != null)
var anchor = world.GetAnchor(x + area.X, y + area.Y);
if (anchor.X == x + area.X && anchor.Y == y + area.Y)
{
var newChest = data.Copy();
newChest.X = x;
newChest.Y = y;
buffer.Chests.Add(newChest);
var data = world.GetChestAtTile(x + area.X, y + area.Y);
if (data != null)
{
var newChest = data.Copy();
newChest.X = x;
newChest.Y = y;
buffer.Chests.Add(newChest);
}
}
}
}
if (Tile.IsSign(curTile.Type))
{
if (buffer.GetSignAtTile(x, y) == null)
{
var data = world.GetSignAtTile(x + area.X, y + area.Y);
if (data != null)
var anchor = world.GetAnchor(x + area.X, y + area.Y);
if (anchor.X == x + area.X && anchor.Y == y + area.Y)
{
var newSign = data.Copy();
newSign.X = x;
newSign.Y = y;
buffer.Signs.Add(newSign);
var data = world.GetSignAtTile(x + area.X, y + area.Y);
if (data != null)
{
var newSign = data.Copy();
newSign.X = x;
newSign.Y = y;
buffer.Signs.Add(newSign);
}
}
}
}
if (Tile.IsTileEntity(curTile.Type))
{
if (buffer.GetTileEntityAtTile(x, y) == null)
{
var data = world.GetTileEntityAtTile(x + area.X, y + area.Y);
if (data != null)
var anchor = world.GetAnchor(x + area.X, y + area.Y);
if (anchor.X == x + area.X && anchor.Y == y + area.Y)
{
var newEntity = data.Copy();
newEntity.PosX = (short)x;
newEntity.PosY = (short)y;
buffer.TileEntities.Add(newEntity);
var data = world.GetTileEntityAtTile(x + area.X, y + area.Y);
if (data != null)
{
var newEntity = data.Copy();
newEntity.PosX = (short)x;
newEntity.PosY = (short)y;
buffer.TileEntities.Add(newEntity);
}
}
}
}
Expand Down

0 comments on commit f26c4e4

Please sign in to comment.