diff --git a/common/src/outcome.rs b/common/src/outcome.rs index 1338d79b40..c4122c8c84 100644 --- a/common/src/outcome.rs +++ b/common/src/outcome.rs @@ -119,7 +119,7 @@ pub enum Outcome { wielded: bool, }, SpriteDelete { - pos: Vec3, + pos: Vec3, sprite: SpriteKind, }, SpriteUnlocked { @@ -171,7 +171,6 @@ impl Outcome { | Outcome::FireShockwave { pos } | Outcome::IceCrack { pos } | Outcome::Utterance { pos, .. } - | Outcome::SpriteDelete { pos, .. } | Outcome::CyclopsCharge { pos } | Outcome::FlamethrowerCharge { pos } | Outcome::LaserBeam { pos } @@ -181,6 +180,7 @@ impl Outcome { | Outcome::Glider { pos, .. } => Some(*pos), Outcome::BreakBlock { pos, .. } | Outcome::SpriteUnlocked { pos } + | Outcome::SpriteDelete { pos, .. } | Outcome::FailedSpriteUnlock { pos } => Some(pos.map(|e| e as f32 + 0.5)), Outcome::ExpChange { .. } | Outcome::ComboChange { .. } diff --git a/common/state/src/state.rs b/common/state/src/state.rs index 415f6afec9..41afed0237 100644 --- a/common/state/src/state.rs +++ b/common/state/src/state.rs @@ -572,17 +572,9 @@ impl State { } let outcome = self.ecs.read_resource::>(); while let Some(outcomes) = scheduled_changes.outcomes.poll(current_time) { - for (pos, block) in outcomes.iter() { - let offset_dir = Vec3::::zero() - pos; - let offset = offset_dir - / Vec3::new(offset_dir.x.abs(), offset_dir.y.abs(), offset_dir.z.abs()); - let outcome_pos = Vec3::new(pos.x as f32, pos.y as f32, pos.z as f32) - - (Vec3::new(offset.x as f32, offset.y as f32, offset.z as f32) / 2.0); + for (pos, block) in outcomes.into_iter() { if let Some(sprite) = block.get_sprite() { - outcome.emit_now(Outcome::SpriteDelete { - pos: outcome_pos, - sprite, - }); + outcome.emit_now(Outcome::SpriteDelete { pos, sprite }); } } } diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 24ffeedc92..34eaeba12c 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -740,13 +740,14 @@ impl SfxMgr { Outcome::SpriteDelete { pos, sprite } => { match sprite { SpriteKind::SeaUrchin => { + let pos = pos.map(|e| e as f32 + 0.5); let power = (0.6 - pos.distance(audio.listener.pos) / 5_000.0) .max(0.0) .powi(7); let sfx_trigger_item = triggers.get_key_value(&SfxEvent::Explosion); audio.emit_sfx( sfx_trigger_item, - *pos, + pos, Some((power.abs() / 2.5).min(0.3)), underwater, ); diff --git a/voxygen/src/scene/particle.rs b/voxygen/src/scene/particle.rs index 1fe2d61148..398ffd5ab5 100644 --- a/voxygen/src/scene/particle.rs +++ b/voxygen/src/scene/particle.rs @@ -79,13 +79,14 @@ impl ParticleMgr { }, Outcome::SpriteDelete { pos, sprite } => match sprite { SpriteKind::SeaUrchin => { + let pos = pos.map(|e| e as f32 + 0.5); self.particles.resize_with(self.particles.len() + 10, || { Particle::new_directed( Duration::from_secs_f32(rng.gen_range(0.1..0.5)), time, ParticleMode::Steam, - *pos + Vec3::new(0.0, 0.0, rng.gen_range(0.0..1.5)), - *pos, + pos + Vec3::new(0.0, 0.0, rng.gen_range(0.0..1.5)), + pos, ) }); },