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

bug in field_of_view? #34

Closed
imoea opened this issue Nov 21, 2019 · 4 comments
Closed

bug in field_of_view? #34

imoea opened this issue Nov 21, 2019 · 4 comments
Assignees
Labels
awaiting confirmation Believed fix, waiting for testing bug Something isn't working

Comments

@imoea
Copy link

imoea commented Nov 21, 2019

https://github.com/thebracket/rustrogueliketutorial/blob/23368c2b6dcc73353eb0cdbf512fde43cdbcf49b/chapter-10-ranged/src/inventory_system.rs#L78

I noticed that the game log was printing duplicate lines whenever I used the Fireball Scroll. At first I thought it had to do with my implemention (because I've made a few tweaks along the way), but upon further investigation, I found out that blasted_tiles.len() was longer than it should be, i.e. field_of_view was returning too many results. More precisely, there were many duplicate indices (the vector is usually 88 long). This happens when I compile your original code too, in both rltk_rs 0.5.2 and 0.5.3.

As I'm new to Rust, I haven't yet been able to trace the error. Maybe you can take a look at it? I'm currently using the latest version of Rust (1.39) with all crates updated.

Thanks!

@thebracket thebracket self-assigned this Nov 22, 2019
@thebracket thebracket added the bug Something isn't working label Nov 22, 2019
@thebracket
Copy link
Collaborator

I do believe you are right. Since the FoV code is in RLTK, I'll setup an issue over there and link it.

@thebracket
Copy link
Collaborator

See: amethyst/bracket-lib#25

@thebracket
Copy link
Collaborator

I've pushed a quick fix to RLTK to resolve this. RLTK version 0.5.7 should fix the problem. You can run cargo update -p rltk to force the git version to update.

@thebracket thebracket added the awaiting confirmation Believed fix, waiting for testing label Nov 22, 2019
@imoea
Copy link
Author

imoea commented Nov 23, 2019

I updated to 0.5.7 but the problem still persisted, so I made some changes and I think it is working as intended now. I've made a pull request. See: amethyst/bracket-lib#26

@imoea imoea closed this as completed Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting confirmation Believed fix, waiting for testing bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants