Переглянути джерело

when pasting, ensure you add a unique name
object names are namespaces, so they cannot match or it confuses the lookup tables

AzaezelX 1 рік тому
батько
коміт
7c5490e841
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      Engine/source/gui/worldEditor/worldEditor.cpp

+ 4 - 0
Engine/source/gui/worldEditor/worldEditor.cpp

@@ -487,6 +487,10 @@ bool WorldEditor::pasteSelection( bool dropSel )
       if ( !obj )
       if ( !obj )
          continue;
          continue;
 
 
+      StringTableEntry baseName = obj->getName();
+      String outName = (baseName != StringTable->EmptyString()) ? Sim::getUniqueName(baseName) : StringTable->EmptyString();
+      obj->assignName(outName);
+
       if (targetGroup)
       if (targetGroup)
          targetGroup->addObject( obj );
          targetGroup->addObject( obj );