Skip to content

Commit

Permalink
fix: Kick Bomb can't be used (#896)
Browse files Browse the repository at this point in the history
While working on the jellyfish I noticed that the kick bomb wasn't
working.

When spawned they didn't get an `ElementHandle` component (or
`MapElementHydrated`). Without an element handle the
`update_idle_kick_bombs` system always skipped over them, preventing
them from being used.
  • Loading branch information
nelson137 authored Jan 7, 2024
1 parent b4e319d commit 956ff39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/elements/kick_bomb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn hydrate(
mut atlas_sprites: CompMut<AtlasSprite>,
assets: Res<AssetServer>,
mut hydrated: CompMut<MapElementHydrated>,
element_handles: Comp<ElementHandle>,
mut element_handles: CompMut<ElementHandle>,
mut animated_sprites: CompMut<AnimatedSprite>,
mut respawn_points: CompMut<DehydrateOutOfBounds>,
mut spawner_manager: SpawnerManager,
Expand Down Expand Up @@ -95,6 +95,8 @@ fn hydrate(
hydrated.insert(spawner_ent, MapElementHydrated);

let entity = entities.create();
hydrated.insert(entity, MapElementHydrated);
element_handles.insert(entity, element_handle);
items.insert(entity, Item);
item_throws.insert(
entity,
Expand Down

0 comments on commit 956ff39

Please sign in to comment.