jdm / libmzx

A Rust library for loading and manipulating MegaZeux worlds.
MIT License
2 stars 0 forks source link

Panic running board #84

Closed jdm closed 3 years ago

jdm commented 3 years ago
Capturing board 1: test board
thread 'main' panicked at 'index out of bounds: the len is 8400 but the index is 12100', /Users/jdm/src/libmzx/src/lib.rs:336:10
stack backtrace:
   0: rust_begin_unwind
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/library/core/src/panicking.rs:69:5
   3: <usize as core::slice::index::SliceIndex<[T]>>::index
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/index.rs:182:10
   4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/index.rs:15:9
   5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/vec.rs:2161:9
   6: libmzx::Board::level_at
             at /Users/jdm/src/libmzx/src/lib.rs:336:10
   7: libmzx::Board::thing_at
             at /Users/jdm/src/libmzx/src/lib.rs:327:24
   8: libmzx::Board::put_at
             at /Users/jdm/src/libmzx/src/lib.rs:478:12
   9: libmzx::board::put_at
             at /Users/jdm/src/libmzx/src/board.rs:113:5
  10: libmzx::board::put_thing
             at /Users/jdm/src/libmzx/src/board.rs:102:5
  11: libmzx::robot::run_one_command
             at /Users/jdm/src/libmzx/src/robot.rs:1544:13
  12: libmzx::robot::update_robot
             at /Users/jdm/src/libmzx/src/robot.rs:469:15
  13: libmzx::board::update_board
             at /Users/jdm/src/libmzx/src/board.rs:189:34
  14: capture::run
             at ./capture/src/main.rs:145:17
  15: capture::main
             at ./capture/src/main.rs:223:9
  16: core::ops::function::FnOnce::call_once
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

https://www.digitalmzx.com/show.php?id=2488

jdm commented 3 years ago

Fixed by 615dae20f2d82a2bab6d19cb089ada5225b55d56