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

Game will panic if get hit and press X at the same time #4

Open
comradez opened this issue Mar 17, 2021 · 0 comments
Open

Game will panic if get hit and press X at the same time #4

comradez opened this issue Mar 17, 2021 · 0 comments

Comments

@comradez
Copy link

I tried this for at least 3 times so I'm sure this is indeed a problem.
If you press X while getting hit, the game will try to play the BG music, the shooting audio, the SpellCard audio and the hit audio at the same time, and it will crash.
It seems that you didn't leave enough audio channels, and that makes the game crash.
The full backtrace message is as follow(my username is hid):

thread 'main' panicked at 'Music cannot be played: "No free channels available"', src/sdl/sdl_audio.rs:24:57
stack backtrace:
   0:     0x55ebaf2ed300 - std::backtrace_rs::backtrace::libunwind::trace::h04d12fdcddff82aa
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
   1:     0x55ebaf2ed300 - std::backtrace_rs::backtrace::trace_unsynchronized::h1459b974b6fbe5e1
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55ebaf2ed300 - std::sys_common::backtrace::_print_fmt::h9b8396a669123d95
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x55ebaf2ed300 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he009dcaaa75eed60
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x55ebaf30762c - core::fmt::write::h77b4746b0dea1dd3
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/fmt/mod.rs:1078:17
   5:     0x55ebaf2eaeb2 - std::io::Write::write_fmt::heb7e50902e98831c
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/io/mod.rs:1518:15
   6:     0x55ebaf2ef685 - std::sys_common::backtrace::_print::h2d880c9e69a21be9
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x55ebaf2ef685 - std::sys_common::backtrace::print::h5f02b1bb49f36879
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x55ebaf2ef685 - std::panicking::default_hook::{{closure}}::h658e288a7a809b29
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:208:50
   9:     0x55ebaf2ef328 - std::panicking::default_hook::hb52d73f0da9a4bb8
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:227:9
  10:     0x55ebaf2efe21 - std::panicking::rust_panic_with_hook::hfe7e1c684e3e6462
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:593:17
  11:     0x55ebaf2ef967 - std::panicking::begin_panic_handler::{{closure}}::h42939e004b32765c
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:499:13
  12:     0x55ebaf2ed7bc - std::sys_common::backtrace::__rust_end_short_backtrace::h9d2070f7bf9fd56c
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x55ebaf2ef8c9 - rust_begin_unwind
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
  14:     0x55ebaf3069d1 - core::panicking::panic_fmt::ha0bb065d9a260792
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:92:14
  15:     0x55ebaf3067f3 - core::option::expect_none_failed::h7e1dd0a94971eb61
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/option.rs:1268:5
  16:     0x55ebaee37ae2 - core::result::Result<T,E>::expect::h0aeaa7b6ef2d31ba
                               at /home/[my_username]/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:933:23
  17:     0x55ebaee48931 - teki::sdl::sdl_audio::SdlAudio::play_sound::h9b90e171a449d6ea
                               at /home/[my_username]/Softwares/teki/src/sdl/sdl_audio.rs:24:13
  18:     0x55ebaee48b4c - <teki::sdl::sdl_audio::SdlAudio as teki_common::traits::audio::Audio>::play_sound::h4420afc1ed281a87
                               at /home/[my_username]/Softwares/teki/src/sdl/sdl_audio.rs:42:9
  19:     0x55ebaee5aa37 - teki_ecs::framework::resources::SoundQueue::flush::h47655d37be4c33b4
                               at /home/[my_username]/Softwares/teki/ecs/src/framework/resources.rs:30:13
  20:     0x55ebaee4edfe - teki_ecs::app::game::Game::update::h191734fa66ea21a7
                               at /home/[my_username]/Softwares/teki/ecs/src/app/game.rs:89:9
  21:     0x55ebaee545b0 - <teki_ecs::app::ecs_app::EcsApp<A,T> as teki_common::traits::app::App<R>>::update::hcb8a072b2bc7cfbb
                               at /home/[my_username]/Softwares/teki/ecs/src/app/ecs_app.rs:148:21
  22:     0x55ebaee4049f - teki::sdl::sdl_app::SdlApp<A>::run::h36691e0e8ad65993
                               at /home/[my_username]/Softwares/teki/src/sdl/sdl_app.rs:73:21
  23:     0x55ebaee36d30 - teki::main::h9c52ff7a93e63798
                               at /home/[my_username]/Softwares/teki/src/main.rs:30:5
  24:     0x55ebaee4f112 - core::ops::function::FnOnce::call_once::hf958263de5b65e7c
                               at /home/[my_username]/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
  25:     0x55ebaee578da - std::sys_common::backtrace::__rust_begin_short_backtrace::h61045acb09f3925e
                               at /home/[my_username]/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125:18
  26:     0x55ebaee3e796 - std::rt::lang_start::{{closure}}::h1ad5932800ed77a8
                               at /home/[my_username]/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66:18
  27:     0x55ebaf2f0247 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h57e2a071d427b24c
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/ops/function.rs:259:13
  28:     0x55ebaf2f0247 - std::panicking::try::do_call::h81cbbe0c3b30a28e
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:381:40
  29:     0x55ebaf2f0247 - std::panicking::try::hbeeb95b4e1f0a876
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:345:19
  30:     0x55ebaf2f0247 - std::panic::catch_unwind::h59c48ccb40a0bf20
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panic.rs:396:14
  31:     0x55ebaf2f0247 - std::rt::lang_start_internal::ha53ab63f88fee728
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/rt.rs:51:25
  32:     0x55ebaee3e767 - std::rt::lang_start::h2388a36e6fa19060
                               at /home/[my_username]/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:65:5
  33:     0x55ebaee36f4a - main
  34:     0x7f9e8b690bf7 - __libc_start_main
  35:     0x55ebaee2baba - _start
  36:                0x0 - <unknown>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant