diff --git a/CHANGELOG.md b/CHANGELOG.md index de98e44886..90d4ddc625 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Connection screen fails after 4 minutes if it can't connect to the server instead of 80 minutes - Rebuilt quadruped_medium animation and assets - Disabled destruction of most blocks by explosions +- Disable damage to pets +- Made pets healable +- Rebalanced fire staff +- Animals are more effective in combat +- Pathfinding is much smoother and pets are cleverer +- Animals run/turn at different speeds ### Removed diff --git a/common/src/lib.rs b/common/src/lib.rs index 5bdead5efe..5111e5a346 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -8,7 +8,7 @@ label_break_value, trait_alias, type_alias_impl_trait, - option_zip, + option_zip )] #[macro_use] extern crate serde_derive; diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index 21da0ef13e..cd2e1208c2 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -242,14 +242,12 @@ impl<'a> System<'a> for Sys { if let (Some(tgt_pos), Some(tgt_stats), tgt_alignment) = ( positions.get(*target), stats.get(*target), - alignments - .get(*target) - .copied() - .unwrap_or(uids - .get(*target) + alignments.get(*target).copied().unwrap_or( + uids.get(*target) .copied() .map(Alignment::Owned) - .unwrap_or(Alignment::Wild)), + .unwrap_or(Alignment::Wild), + ), ) { if let Some(dir) = Dir::from_unnormalized(tgt_pos.0 - pos.0) { inputs.look_dir = dir; diff --git a/common/src/sys/projectile.rs b/common/src/sys/projectile.rs index 056806786c..306b0bab10 100644 --- a/common/src/sys/projectile.rs +++ b/common/src/sys/projectile.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ - projectile, Energy, EnergySource, HealthSource, Ori, PhysicsState, Pos, Projectile, Vel, - Alignment, + projectile, Alignment, Energy, EnergySource, HealthSource, Ori, PhysicsState, Pos, + Projectile, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -89,11 +89,11 @@ impl<'a> System<'a> for Sys { // Hacky: remove this when groups get implemented let passive = uid_allocator .retrieve_entity_internal(other.into()) - .and_then(|other| + .and_then(|other| { alignments - .get(other) - .map(|a| Alignment::Owned(owner_uid) - .passive_towards(*a))) + .get(other) + .map(|a| Alignment::Owned(owner_uid).passive_towards(*a)) + }) .unwrap_or(false); if other != projectile.owner.unwrap() && !passive { server_emitter.emit(ServerEvent::Damage { uid: other, change }); diff --git a/server/src/cmd.rs b/server/src/cmd.rs index f44c5743e1..8e7f3517e7 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -507,7 +507,10 @@ fn handle_spawn( String ) { (Some(opt_align), Some(npc::NpcBody(id, mut body)), opt_amount, opt_ai) => { - let uid = server.state.read_component_cloned(target).expect("Expected player to have a UID"); + let uid = server + .state + .read_component_cloned(target) + .expect("Expected player to have a UID"); if let Some(alignment) = parse_alignment(uid, &opt_align) { let amount = opt_amount .and_then(|a| a.parse().ok()) diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index 7b9f5fc753..b33a170e0b 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -188,7 +188,8 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv let reinsert = if let Some(pos) = state.read_storage::().get(entity) { - let uid = state.read_component_cloned(entity) + let uid = state + .read_component_cloned(entity) .expect("Expected player to have a UID"); if ( &state.read_storage::(), @@ -222,10 +223,10 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv .map(|(entity, _, _)| entity); nearest_tameable } { - let _ = state.ecs().write_storage().insert( - tameable_entity, - comp::Alignment::Owned(uid), - ); + let _ = state + .ecs() + .write_storage() + .insert(tameable_entity, comp::Alignment::Owned(uid)); let _ = state .ecs() .write_storage() diff --git a/server/src/state_ext.rs b/server/src/state_ext.rs index a9b300dea9..645e7843d4 100644 --- a/server/src/state_ext.rs +++ b/server/src/state_ext.rs @@ -171,7 +171,10 @@ impl StateExt for State { }); self.write_component(entity, comp::Gravity(1.0)); self.write_component(entity, comp::CharacterState::default()); - self.write_component(entity, comp::Alignment::Owned(self.read_component_cloned(entity).unwrap())); + self.write_component( + entity, + comp::Alignment::Owned(self.read_component_cloned(entity).unwrap()), + ); // Set the character id for the player // TODO this results in a warning in the console: "Error modifying synced diff --git a/server/src/sys/sentinel.rs b/server/src/sys/sentinel.rs index 7fc0f9a59a..55da254f51 100644 --- a/server/src/sys/sentinel.rs +++ b/server/src/sys/sentinel.rs @@ -1,8 +1,8 @@ use super::SysTimer; use common::{ comp::{ - Body, CanBuild, CharacterState, Collider, Energy, Gravity, Item, LightEmitter, Loadout, - Mass, MountState, Mounting, Ori, Player, Pos, Scale, Stats, Sticky, Vel, Alignment, + Alignment, Body, CanBuild, CharacterState, Collider, Energy, Gravity, Item, LightEmitter, + Loadout, Mass, MountState, Mounting, Ori, Player, Pos, Scale, Stats, Sticky, Vel, }, msg::EcsCompPacket, sync::{CompSyncPackage, EntityPackage, EntitySyncPackage, Uid, UpdateTracker, WorldSyncExt}, diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 5592cad96d..ea83cf918c 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -59,10 +59,7 @@ impl SessionState { { let mut client = client.borrow_mut(); let my_entity = client.entity(); - client - .state_mut() - .ecs_mut() - .insert(MyEntity(my_entity)); + client.state_mut().ecs_mut().insert(MyEntity(my_entity)); } let voxygen_i18n = load_expect::(&i18n_asset_key( &global_state.settings.language.selected_language,