Conversation
| end | ||
|
|
||
| -- Sets a node’s name during a VoxelManipulator-based transaction. | ||
| -- Aliases may not work correctly. |
There was a problem hiding this comment.
| -- Aliases may not work correctly. | |
| -- Aliases may not work correctly if mesecon.get_conductor(name).states was touched by a mod. |
That's how I understood the problem, right? If you want to make sure they're not modified, consider metatables. At least the reason why it may not work correct should be stated here.
There was a problem hiding this comment.
The issue can occur if a mod swaps in a node whose name is actually an alias.
There was a problem hiding this comment.
Then please be so nice to mention in which cases this function is expected to work, and when not.
There was a problem hiding this comment.
I will make some changes after #614 is merged or closed. If it is merged, I can make some further changes to the code then remove the notice. This PR is basically blocked for now.
|
Actually, I think I can fix the alias problem in conjunction with #614. |
I think they were broken by #600, since the name of a node from the cache may now be an alias. So as not to risk slowing down the oft-called
mesecon.vm_swap_node, I decided to fix this by resolving any aliases beforehand. This has the added benefit of fixing conductors with more than two states which have aliases in their state lists; before they would crash. The downside is that mesecons specifications may be modified, which is not documented. On the other hand, it isn't documented that they won't be modified, either. Sharing state lists between multiple conductors still works.The tests from #605 pass.