Open wlinna opened 3 years ago
@wlinna - it seems that this stems from an ambiguity in the Tiled TMX spec that doesn't specify whether newlines are meaningful. Take the assumption made by tiled-rs (which we rely on) that they are, coupled with ldtk's exporter flattening this CSV data , and you have the perfect storm for this bug.
We could write in a workaround, but it seems like that effort would be better served opening a PR to tiled-rs or ldtk...
Thanks for the info. I'll report there
A new version of rs-tiled addressing the issue has been published. I haven't tried it with bevy_tiled yet though (cargo-lock specifies 0.9.4 anyway)
Alright, I found an easy way to update a transitive dependency (yay):
cargo update -p tiled --precise 0.9.5
Now it works. This issue can be closed once you upgrade tiled.
Again, thanks for the information – it helped me report the issue
Hello,
bevy_tiled
crashes withIndex out of bounds
when a TMX's data (CSV) is missing new-lines. I used ldtk's TMX export to create my TMX file. Here's a small file to reproduce the issue:It works if I change
data
node to this:Here's how I use
bevy_tiled
Here's the error:
thread 'IO Task Pool (0)' panicked at 'index out of bounds: the len is 1 but the index is 1', /*/github.com-1ecc6299db9ec823/bevy_tiled_prototype-0.2.3/src/map.rs:186:46
It works if I break the lines manually or first import my TMX into Tiled editor and then save.