Fix for selecting multiple entities in MLO via project explorer

This commit is contained in:
dexy 2021-11-21 00:20:03 +11:00
parent a2538fc976
commit 67014c4d39

View File

@ -765,6 +765,19 @@ namespace CodeWalker.Project
{
if (item is object[] arr)
{
for (int i = 0; i < arr.Length; i++)
{
if (arr[i] is MCEntityDef mcent)//for MLO entities, need to transform this into an actual entity instance
{
var instance = TryGetMloInstance(mcent.OwnerMlo);
if (instance != null)
{
arr[i] = instance.TryGetYmapEntity(mcent);
}
}
}
var multisel = MapSelection.FromProjectObject(arr); //convert to MapSelection array
item = multisel.MultipleSelectionItems;
}