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

Asset path wrong parsed (probably) #5707

Closed
r4v3n6101 opened this issue Aug 15, 2022 Discussed in #5704 · 2 comments
Closed

Asset path wrong parsed (probably) #5707

r4v3n6101 opened this issue Aug 15, 2022 Discussed in #5704 · 2 comments
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@r4v3n6101
Copy link

Discussed in #5704

Originally posted by r4v3n6101 August 15, 2022
Hello. Recently I've found a strange logic of loading assets here
If we use something with 2 "#" in asset_path then we never get full label because only 2 parts of label taken (asset.zip#123#abc => asset.zip as path and 123 as label). Probably there should be used the splitn method, am I right? Should we ever use 2 "#" in paths?

@rparrett
Copy link
Contributor

Using splitn there does seem more appropriate. It looks like we're just assuming that a label will never contain a #.

@rparrett rparrett added C-Feature A new feature, making something new possible C-Code-Quality A section of code that is hard to understand or change D-Trivial Nice and easy! A great choice to get started with Bevy C-Bug An unexpected or incorrect behavior A-Assets Load files from disk to use for things like images, models, and sounds and removed C-Feature A new feature, making something new possible C-Code-Quality A section of code that is hard to understand or change labels Aug 15, 2022
@r4v3n6101
Copy link
Author

r4v3n6101 commented Aug 15, 2022

We should also consider that only from_string argument will not contain #. User still shouldn't be limited to create a label with #, one can use AssetPath::new or AssetPath::new_ref.

@bors bors bot closed this as completed in 1c6be94 Aug 18, 2022
inodentry pushed a commit to BroovyJammy/bevy that referenced this issue Aug 19, 2022
# Objective

- Fixes bevyengine#5707 

## Solution

- Used `splitn` instead of `split` to collect the rest of the string into the label after the first '#'.

---
maccesch pushed a commit to Synphonyte/bevy that referenced this issue Sep 28, 2022
# Objective

- Fixes bevyengine#5707 

## Solution

- Used `splitn` instead of `split` to collect the rest of the string into the label after the first '#'.

---
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
# Objective

- Fixes bevyengine#5707 

## Solution

- Used `splitn` instead of `split` to collect the rest of the string into the label after the first '#'.

---
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

- Fixes bevyengine#5707 

## Solution

- Used `splitn` instead of `split` to collect the rest of the string into the label after the first '#'.

---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants