Paste into different files bug fix, multiple selection clone bug fix, fix for collisions editing crash

This commit is contained in:
dexy 2020-01-14 12:54:45 +11:00
parent 3f24a234e6
commit acba388358
2 changed files with 20 additions and 15 deletions

View File

@ -1502,7 +1502,6 @@ namespace CodeWalker.Project
public object NewObject(MapSelection sel, bool copyPosition = false, bool selectNew = true)
{
//general method to add a new object, given a map selection
SetObject(ref sel);
if (sel.MultipleSelectionItems != null)
{
var objs = new List<object>();
@ -6789,6 +6788,12 @@ namespace CodeWalker.Project
}
else
{
if ((sel.MultipleSelectionItems != null) && (sel.MultipleSelectionItems.Length > 0))
{
SetObject(ref sel.MultipleSelectionItems[sel.MultipleSelectionItems.Length - 1]);
return;
}
var mlo = sel.MloEntityDef;
var room = sel.MloRoomDef;
var ent = sel.EntityDef;

View File

@ -1766,23 +1766,23 @@ namespace CodeWalker
public void UpdateCollisionBoundsGraphics(Bounds b)
{
if (b is BoundBVH bvh)
lock (Renderer.RenderSyncRoot)
{
bvh.BuildBVH();
}
else if (b is BoundComposite bc)
{
bc.BuildBVH();
}
if (b is BoundBVH bvh)
{
bvh.BuildBVH();
}
else if (b is BoundComposite bc)
{
bc.BuildBVH();
}
var ib = b;
while (ib.Parent != null)
{
ib = ib.Parent;
}
var ib = b;
while (ib.Parent != null)
{
ib = ib.Parent;
}
//lock (Renderer.RenderSyncRoot)
{
Renderer.Invalidate(ib);
}
}