thombruce / verse

🚀 A universe in progress
Other
8 stars 0 forks source link

Crash to Desktop (Enemy Targeting) #73

Closed thombruce closed 12 months ago

thombruce commented 12 months ago

The error:

thread 'main' panicked at 'error[B0003]: Could not insert a bundle (of type `verse::ships::enemy::Targeting`) for entity 33v1 because it doesn't exist in this World.', C:\Users\thom\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.11.3\src\system\commands\mod.rs:957:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic when applying buffers for system `verse::ships::enemy::enemy_targeting_system`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
error: process didn't exit successfully: `target\debug\verse.exe` (exit code: 101)

Could be related to work ongoing on #72 - I'm migrating systems into a central location and in doing so have made some plugin interfaces redundant and removed them. There are no material code changes, so I imagine this is a pre-existing problem that the new structure has brought to light. That is to say, it must be a systems order of execution issue which was previously hidden by plugin load order or something like that. Before #72 is done, the systems will be further refactored and placed into more appropriate schedules, system sets and state conditionals - hopefully this resolves this issue.

thombruce commented 12 months ago

The error reads like:

Can't insert the Targeting component onto Enemy because Enemy doesn't exist

This doesn't happen all the time (I have successfully just played a game in which I destroyed all enemies) but is happening early into gameplay. Main difference: I initially let the enemies damage the player before playing, but I doubt this has any effect on the bug.