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 path with multiple slashes not being corrected on templates #52513

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

rsubtil
Copy link
Contributor

@rsubtil rsubtil commented Sep 9, 2021

Fixes #52507

Paths with multiple slashes like res://folder//folder//folder//icon.png were not being simplified on export templates because these load from PCK files, and thus resource_path is never set.

@rsubtil rsubtil requested a review from a team as a code owner September 9, 2021 14:50
}

if (p_path.begins_with("res://") || p_path.begins_with("user://") ||
if (resource_path == "" || p_path.begins_with("res://") || p_path.begins_with("user://") ||
Copy link
Contributor

Choose a reason for hiding this comment

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

[Cosmetic] Wouldn't it be better to change the first condition resource_path == "" into resource_path.is_empty?

if (resource_path.is_empty() || p_path.begins_with("res://") || p_path.begins_with("user://") ||

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's also more efficient, thanks for the tip 👍

@rsubtil rsubtil force-pushed the fix_path_double_slash branch from 649e357 to eef0327 Compare September 10, 2021 10:14
@mhilbrunner mhilbrunner added this to the 4.0 milestone Sep 10, 2021
@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 20, 2021
@akien-mga akien-mga merged commit 0068247 into godotengine:master Sep 20, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 20, 2021
@rsubtil rsubtil deleted the fix_path_double_slash branch November 26, 2021 16:35
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.

Paths with "//" instead of "/" works in editor but not in export
4 participants