Commit 2ebab52
authored
Prevent panic when despawning entities with NoAuto components (#608)
# Objective
- This prevents a panic that can occur if an entity with one of the NoAuto components is despawned.
- Fixes #607
## Solution
This solution to the problem just uses the non-panicking versions of retrieving an entity from the world and inserting a component in the on_remove_no_auto_mass_property function that runs when the component is removed.
I think an argument could be made that this silently hides an issue of code trying to operate on an entity that no longer exists or that the on_remove shouldn't fire if it's happening because an entity is being despawned.1 parent 5b80901 commit 2ebab52
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
980 | 979 | | |
981 | 980 | | |
982 | 981 | | |
| |||
0 commit comments