Skip to content

Commit

Permalink
chore: fix tasks for wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrossi committed Apr 25, 2024
1 parent 7023007 commit 7781b50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/ryot_app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub mod prelude {
pub use crate::{
content::{BaseContentPlugin, MetaContentPlugin, VisualContentPlugin},
content_plugin,
game::{ElevationPlugin, GamePlugin},
game::{ElevationPlugin, GamePlugin, TileFlagPlugin},
sprites::{RyotDrawingPlugin, RyotSpritePlugin},
};

Expand Down
6 changes: 4 additions & 2 deletions crates/ryot_pathfinder/src/components.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::Pathable;
use bevy_ecs::prelude::*;
use bevy_tasks::Task;
use derive_more::*;
use std::hash::Hash;
use std::time::Duration;
Expand All @@ -22,7 +21,10 @@ pub struct Path<P: Pathable>(pub(crate) Vec<P>);

/// Component that holds a task running path finding with a potential path find result.
#[derive(Component)]
pub(crate) struct PathFindingTask<P: Pathable>(pub(crate) Task<Option<(Vec<P>, u32)>>);
pub(crate) struct PathFindingTask<P: Pathable>(
#[cfg(not(target_arch = "wasm32"))] pub(crate) bevy_tasks::Task<Option<(Vec<P>, u32)>>,
#[cfg(target_arch = "wasm32")] pub(crate) bevy_tasks::single_threaded_task_pool::FakeTask,
);

impl<P: Pathable + Default> Default for PathFindingQuery<P> {
fn default() -> Self {
Expand Down

0 comments on commit 7781b50

Please sign in to comment.