Jump to content

Copied entities seems share same component in editor


Go to solution Solved by Josh,

Recommended Posts

Posted

I think internally some of the sub-tables are sharing the same STL map. No idea why brushes don't also exhibit this behavior.

I can either change the way the map is stored in the table, which could cause other problems possibly, or implement a table copy mechanism.

Let me think about this...

Let's build cool stuff and have fun. :)

Posted

I guess the way it is working right now is actually correct, according to the Lua way. In Lua, if you assign a table to a new variable, it will still contain the same subtables. So a table copy feature would be needed to sort this out.

Let's build cool stuff and have fun. :)

  • Solution
Posted

I was able to solve this problem simply by changing this code:

entity->exportproperties = exportproperties;
entity->importproperties = importproperties;

To this:

entity->exportproperties = exportproperties.copy();
entity->importproperties = importproperties.copy();

The fix will be in the next build that goes up.

  • Thanks 1

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...