Update changelog, address comments, fmt

This commit is contained in:
Imbris 2020-10-29 18:46:28 -04:00
parent 64def3cde4
commit cb68aec291
3 changed files with 46 additions and 35 deletions

View File

@ -54,6 +54,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved hammer leap attack to skillbar - Moved hammer leap attack to skillbar
- Reworked fire staff - Reworked fire staff
- Overhauled cloud shaders to add mist, light attenuation, an approximation of rayleigh scattering, etc. - Overhauled cloud shaders to add mist, light attenuation, an approximation of rayleigh scattering, etc.
- Fixed a bug where a nearby item would also be collected when collecting collectible blocks
- Allowed collecting nearby blocks without aiming at them
- Made voxygen wait until singleplayer server is initialized before attempting to connect, removing the chance for it to give up on connecting if the server takes a while to start
- Log where userdata folder is located
### Removed ### Removed

View File

@ -66,7 +66,7 @@ hashbrown = {version = "0.7.2", features = ["rayon", "serde", "nightly"]}
image = {version = "0.23.8", default-features = false, features = ["ico", "png"]} image = {version = "0.23.8", default-features = false, features = ["ico", "png"]}
native-dialog = { version = "0.4.2", default-features = false, optional = true } native-dialog = { version = "0.4.2", default-features = false, optional = true }
num = "0.2" num = "0.2"
ordered-float = "2.0.0" ordered-float = { version = "2.0.0", default-features = false }
rand = "0.7" rand = "0.7"
rodio = {version = "0.11", default-features = false, features = ["wav", "vorbis"]} rodio = {version = "0.11", default-features = false, features = ["wav", "vorbis"]}
ron = {version = "0.6", default-features = false} ron = {version = "0.6", default-features = false}

View File

@ -15,9 +15,7 @@ use client::{self, Client};
use common::{ use common::{
assets::Asset, assets::Asset,
comp, comp,
comp::{ comp::{ChatMsg, ChatType, InventoryUpdateEvent, Pos, Vel},
ChatMsg, ChatType, InventoryUpdateEvent, Pos, Vel,
},
consts::{MAX_MOUNT_RANGE, MAX_PICKUP_RANGE}, consts::{MAX_MOUNT_RANGE, MAX_PICKUP_RANGE},
event::EventBus, event::EventBus,
outcome::Outcome, outcome::Outcome,
@ -274,17 +272,23 @@ impl PlayState for SessionState {
.get(self.client.borrow().entity()) .get(self.client.borrow().entity())
.is_some(); .is_some();
let interactable = select_interactable(&self.client.borrow(), self.target_entity, select_pos, &self.scene); let interactable = select_interactable(
&self.client.borrow(),
self.target_entity,
select_pos,
&self.scene,
);
// Only highlight interactables // Only highlight interactables
// unless in build mode where select_pos highlighted // unless in build mode where select_pos highlighted
self.scene.set_select_pos( self.scene
.set_select_pos(
select_pos select_pos
.filter(|_| can_build) .filter(|_| can_build)
.or_else(|| match interactable { .or_else(|| match interactable {
Some(Interactable::Block(_, block_pos)) => Some(block_pos), Some(Interactable::Block(_, block_pos)) => Some(block_pos),
_ => None, _ => None,
}) }),
); );
// Handle window events. // Handle window events.
@ -467,10 +471,13 @@ impl PlayState for SessionState {
&client.state().ecs().read_storage::<comp::MountState>(), &client.state().ecs().read_storage::<comp::MountState>(),
) )
.join() .join()
.filter(|(entity, _, mount_state)| *entity != client.entity() .filter(|(entity, _, mount_state)| {
*entity != client.entity()
&& **mount_state == comp::MountState::Unmounted && **mount_state == comp::MountState::Unmounted
) })
.map(|(entity, pos, _)| (entity, player_pos.0.distance_squared(pos.0))) .map(|(entity, pos, _)| {
(entity, player_pos.0.distance_squared(pos.0))
})
.filter(|(_, dist_sqr)| *dist_sqr < MAX_MOUNT_RANGE.powi(2)) .filter(|(_, dist_sqr)| *dist_sqr < MAX_MOUNT_RANGE.powi(2))
.min_by_key(|(_, dist_sqr)| OrderedFloat(*dist_sqr)); .min_by_key(|(_, dist_sqr)| OrderedFloat(*dist_sqr));
if let Some((mountee_entity, _)) = closest_mountable_entity { if let Some((mountee_entity, _)) = closest_mountable_entity {
@ -488,10 +495,13 @@ impl PlayState for SessionState {
if let Some(interactable) = interactable { if let Some(interactable) = interactable {
let mut client = self.client.borrow_mut(); let mut client = self.client.borrow_mut();
match interactable { match interactable {
Interactable::Block(block, pos) => if block.is_collectible() { Interactable::Block(block, pos) => {
if block.is_collectible() {
client.collect_block(pos); client.collect_block(pos);
}
}, },
Interactable::Entity(entity) => if client Interactable::Entity(entity) => {
if client
.state() .state()
.ecs() .ecs()
.read_storage::<comp::Item>() .read_storage::<comp::Item>()
@ -499,6 +509,7 @@ impl PlayState for SessionState {
.is_some() .is_some()
{ {
client.pick_up(entity); client.pick_up(entity);
}
}, },
} }
} }
@ -1242,11 +1253,7 @@ fn select_interactable(
scene: &Scene, scene: &Scene,
) -> Option<Interactable> { ) -> Option<Interactable> {
span!(_guard, "select_interactable"); span!(_guard, "select_interactable");
use common::{ use common::{spiral::Spiral2d, terrain::TerrainChunk, vol::RectRasterableVol};
spiral::Spiral2d,
terrain::TerrainChunk,
vol::RectRasterableVol,
};
target_entity.map(Interactable::Entity) target_entity.map(Interactable::Entity)
.or_else(|| selected_pos.and_then(|sp| .or_else(|| selected_pos.and_then(|sp|
client.state().terrain().get(sp).ok().copied() client.state().terrain().get(sp).ok().copied()