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

Crash when shooting grenades #8

Open
martin-t opened this issue Oct 7, 2021 · 2 comments
Open

Crash when shooting grenades #8

martin-t opened this issue Oct 7, 2021 · 2 comments

Comments

@martin-t
Copy link
Contributor

martin-t commented Oct 7, 2021

I throw a grenade, shoot it with the default gun and after a short while (when it's supposed to explode?) the game crashes.

thread 'main' panicked at 'Attempt to borrow destroyed object at [Idx: 819; Gen: 1] handle.', /home/martin/dev/rust/rg3d/rg3d-core/src/pool.rs:504:21
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:457:5
   2: <rg3d_core::pool::Pool<T> as core::ops::index::IndexMut<rg3d_core::pool::Handle<T>>>::index_mut
   3: <alloc::vec::Vec<T> as rg3d_core::VecExtensions<T>>::retain_mut
   4: station_iapetus::level::BaseLevel::update
   5: station_iapetus::Game::update
   6: station_iapetus::Game::run::{{closure}}
   7: winit::platform_impl::platform::x11::EventLoop<T>::run
   8: winit::platform_impl::platform::EventLoop<T>::run
   9: winit::event_loop::EventLoop<T>::run
  10: station_iapetus::Game::run
  11: station_iapetus::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@LordCocoNut
Copy link

LordCocoNut commented Nov 28, 2021

I did a little investigation, and I think this might be caused by the decals system. Will try to fix it and possibly do pull request.

@LordCocoNut
Copy link

LordCocoNut commented Nov 28, 2021

Ok, since im beginner to rust and I dont know the inner processes of Iapeteus or Engine so i wont be able to fix it, but i think the problem is caused at line 1208 in /src/level/mod.rs, where is being handled parent to add bullet decal to. I think cause of that there is being decal created for grenade and after cleaning up from projectile.rs there remains decal reference for it, which causes error.

Dont know if there should be a mechanism to clear decals in clean_up methods before the node is being destroyed.

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

2 participants