Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attachment nodes becoming unusable in editor after undo #1572

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mhoram-kerbin
Copy link
Contributor

fix #1571

The attach nodes of Wolf Cargo Containers are defined like this:

	node_stack_side   =	   0,  0, -0.5,  0,  0, -1, 1
	node_stack_side_1 =	   0,  0,  0.5,  0,  0,  1, 1
	node_stack_side_2 =	-0.5,  0,    0, -1,  0,  0, 1
	node_stack_side_4 =	 0.5,  0,    0,  1,  0,  0, 1

However after attaching parts to each of the side nodes, they get saved in the .craft file as:

	attN = side,advSasModule_4294251462_0|0|-0.5_0|0|-1_0|0|-0.5_0|0|-1
	attN = side,advSasModule_4294251836_0|0|0.5_0|0|1_0|0|0.5_0|0|1
	attN = side,advSasModule_4294251088_-0.5|0|0_-1|0|0_-0.5|0|0_-1|0|0
	attN = side,advSasModule_4294250716_0.5|0|0_1|0|0_0.5|0|0_1|0|0

This indicates that all 4 attached parts are attached to the same attach node "node_stack_side"

Also in the save game, the Wolf Cargo Container looks like this:

	srfN = srfAttach, -1
	attN = side, -1
	attN = side, -1
	attN = side, -1
	attN = side, -1
	attN = top, 0
	attN = bottom, -1

This indicates four times, that the attach node "node_stack_side" has no part "-1" attached to it but says nothing about the other three attach nodes.

My conclusion is, that the node_stack definitions are parsed in a strange way when more than two underscores "_" appear in the definition.

This PR changes the definitions by removing the third underscore.

I can't tell for sure, if this change makes problems for existing savegames, so I would appreciate it, if someone with more experience could verify, if this is a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undo (Ctrl-Z) in editor makes attachNodes of some parts unusable
1 participant