Addressed comments

This commit is contained in:
Snowram 2020-11-15 02:17:41 +01:00 committed by Robin Gilh
parent 93642428f2
commit 7af561263d
3 changed files with 5 additions and 8 deletions

View File

@ -343,10 +343,10 @@ impl<'a> System<'a> for Sys {
) {
controller.actions.push(ControlAction::Wield);
let eye_offset = body.map_or(1.0, |b| b.eye_height());
let eye_offset = body.map_or(0.0, |b| b.eye_height());
let tgt_eye_offset =
bodies.get(*target).map_or(1.0, |b| b.eye_height());
bodies.get(*target).map_or(0.0, |b| b.eye_height());
let distance_offset = match tactic {
Tactic::Bow => 0.0004 * pos.0.distance_squared(tgt_pos.0),

View File

@ -118,8 +118,7 @@ pub fn handle_shoot(
.ecs()
.read_storage::<comp::Body>()
.get(entity)
.map(|b| b.scale())
.unwrap_or(1.0);
.map_or(0.0, |b| b.scale());
pos.z += eye_height;

View File

@ -472,16 +472,14 @@ impl Scene {
.ecs()
.read_storage::<comp::Body>()
.get(scene_data.player_entity)
.map(|b| b.scale())
.unwrap_or(1.0);
.map_or(1.0, |b| b.scale());
let eye_height = scene_data
.state
.ecs()
.read_storage::<comp::Body>()
.get(scene_data.player_entity)
.map(|b| b.eye_height())
.unwrap_or(1.0);
.map_or(0.0, |b| b.eye_height());
// Add the analog input to camera
self.camera