jdm / libmzx

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

Panic setting color >16 #16

Open jdm opened 4 years ago

jdm commented 4 years ago
Capturing board 3: init failed
thread 'main' panicked at 'index out of bounds: the len is 16 but the index is 16', /Users/jdm/src/libmzx/src/robot.rs:621:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1/library/std/src/panicking.rs:475
   1: core::panicking::panic_fmt
             at /rustc/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1/library/core/src/panicking.rs:85
   2: core::panicking::panic_bounds_check
             at /rustc/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1/library/core/src/panicking.rs:62
   3: <usize as core::slice::SliceIndex<[T]>>::index_mut
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/mod.rs:3291
   4: core::slice::<impl core::ops::index::IndexMut<I> for [T]>::index_mut
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/mod.rs:3137
   5: <alloc::vec::Vec<T> as core::ops::index::IndexMut<I>>::index_mut
             at /Users/jdm/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/vec.rs:2024
   6: libmzx::robot::run_one_command
             at /Users/jdm/src/libmzx/src/robot.rs:621
   7: libmzx::robot::update_robot
             at /Users/jdm/src/libmzx/src/robot.rs:390
   8: libmzx::board::update_board
             at /Users/jdm/src/libmzx/src/board.rs:145
   9: capture::run
             at ./capture/src/main.rs:124
  10: capture::main
             at ./capture/src/main.rs:203
  11: 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:233
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
jdm commented 4 years ago

This is a set color command with the color value greater than 16.