Some new wall sprites, wires are automatically dropped if both items they're attached to are removed, other items aren't highlighted while dragging an item in editor

This commit is contained in:
Regalis
2016-05-22 01:31:36 +03:00
parent b2f83b43f8
commit 00b1ec38e2
8 changed files with 107 additions and 49 deletions

View File

@@ -454,7 +454,7 @@ namespace Barotrauma
{
MapEntity me = MapEntity.mapEntityList[i];
if (me.SimPosition.Length()>200.0f)
if (me.SimPosition.Length()>2000.0f)
{
DebugConsole.NewMessage("Removed "+me.Name+" (simposition "+me.SimPosition+")", Color.Orange);
MapEntity.mapEntityList.RemoveAt(i);
@@ -464,6 +464,19 @@ namespace Barotrauma
DebugConsole.NewMessage("Removed " + me.Name + " (MoveWithLevel==true)", Color.Orange);
MapEntity.mapEntityList.RemoveAt(i);
}
else if (me is Item)
{
Item item = me as Item;
var wire = item.GetComponent<Wire>();
if (wire == null) continue;
if (wire.Nodes.Any() && !wire.Connections.Any(c => c != null))
{
wire.Item.Drop(null);
DebugConsole.NewMessage("Dropped wire (ID: "+wire.Item.ID+") - attached on wall but no connections found", Color.Orange);
}
}
}
break;
case "messagebox":