nsmryan / RustRoguelike

This Rust Roguelike is a Roguelike written in Rust.
17 stars 3 forks source link

Pass Through causes crash #459

Closed MicroChasm closed 2 years ago

MicroChasm commented 2 years ago

When using Pass Through on a wall or golem, I get a crash with this error:

thread 'main' panicked at 'index out of bounds: the len is 20 but the index is 20', roguelike_core\src\level.rs:36:59 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace error: process didn't exit successfully: target\debug\rl.exe (exit code: 101)

nsmryan commented 2 years ago

I fixed up the pass-through skill a bit, but I didn't see this error.

I found that there are some places where checking for blocking tiles could cause an error like that and I included bounds checks, so this may help with the error you saw.

MicroChasm commented 2 years ago

Ok, I think we can close the issue for now then and see if it happens again. I feel that we are going to be doing a lot more work on class skills soon and we will be testing this sort of thing a lot.