Skip to content

Commit

Permalink
Fix bug where you sometimes get stuck on a step up
Browse files Browse the repository at this point in the history
  • Loading branch information
Rua committed Sep 15, 2021
1 parent bf5de95 commit 6027083
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/doom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ pub fn load_game(name: &str, world: &mut World, resources: &mut Resources) {
.as_deserialize_into_world(world, &*canon)
.deserialize(&mut deserializer)
.context("Couldn't deserialize world")?;

Ok(saved_resources)
})
}
Expand All @@ -582,6 +583,12 @@ pub fn load_game(name: &str, world: &mut World, resources: &mut Resources) {
let quadtree = create_quadtree(world, resources);
resources.insert(quadtree);

{
let (render_context, mut asset_storage) =
<(Read<RenderContext>, Write<AssetStorage>)>::fetch_mut(resources);
process_images(&render_context, &mut asset_storage);
}

log::info!("Game loaded.");
}
Err(err) => log::error!("{:?}", err),
Expand Down
1 change: 1 addition & 0 deletions src/doom/physics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ fn step_slide_move<W: EntityStore>(

if trace.collision.is_none() {
*position = trace.move_step.end_point();
velocity[2] = velocity[2].max(0.0); // Do not fall back down
step_events.push(StepEvent { entity, height });

// Touch nonsolids
Expand Down

0 comments on commit 6027083

Please sign in to comment.