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 duplicating/copying TileMap #88105

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Feb 8, 2024

Using force_parent_owned to prevent issues duplicating

Think this covers all cases

@AThousandShips

This comment was marked as outdated.

@AThousandShips AThousandShips marked this pull request as draft February 8, 2024 14:53
@AThousandShips

This comment was marked as outdated.

@AThousandShips

This comment was marked as outdated.

@AThousandShips
Copy link
Member Author

AThousandShips commented Feb 8, 2024

It seems this is relatively trivial, will look at a different fix leveraging is_owned_by_parent

Edit: Better solution, will push momentarily

@AThousandShips AThousandShips marked this pull request as ready for review February 8, 2024 15:47
Using `force_parent_owned` to prevent issues duplicating
@AThousandShips
Copy link
Member Author

I've identified a few other places where force_parent_owned might be needed and will look at a PR for that too

Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this solution is better. In the future, though, if/when layers are exposed, these snippets should be removed, otherwise you get into a nasty bug. Maybe adding a comment on the side can help?

@AThousandShips
Copy link
Member Author

AThousandShips commented Feb 8, 2024

They shouldn't be removed even then, the layers would be doubled because the recreation of the data from the properties, I didn't realise that in my first attempt but it had extra layers because the map doesn't detect them being added, granted with more such details that would work but alone these lines shouldn't be removed even if the layer is exposed

@akien-mga akien-mga merged commit 821bf4b into godotengine:master Feb 12, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@AThousandShips
Copy link
Member Author

Thank you!

@AThousandShips AThousandShips deleted the tile_duplicate_fix branch February 12, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TileMap can't be duplicated or copied in editor
3 participants