diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb0621101..61d48402c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,11 +17,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use fluent for translations - First tab on Login screen triggers username focus - Certain NPCs will now attack when alone with victim +- /kill_npcs no longer leaves drops behind and also has bug causing it to not destroy entities + fixed. ### Removed ### Fixed - Fixed crash due to zooming out very far +- Client properly knows trade was cancelled when exiting to the character screen (and no longer + tries to display the trade window when rejoining) +- Cancel trades for an entity when it is deleted (note this doesn't effect trades between players + since their entities are not removed). ## [0.13.0] - 2022-07-23 diff --git a/server/src/events/player.rs b/server/src/events/player.rs index 69305343d1..1163ccab60 100644 --- a/server/src/events/player.rs +++ b/server/src/events/player.rs @@ -1,8 +1,7 @@ use super::Event; use crate::{ - client::Client, metrics::PlayerMetrics, - persistence::character_updater::CharacterUpdater, presence::Presence, state_ext::StateExt, - BattleModeBuffer, Server, + client::Client, metrics::PlayerMetrics, persistence::character_updater::CharacterUpdater, + presence::Presence, state_ext::StateExt, BattleModeBuffer, Server, }; use common::{ comp, @@ -31,8 +30,9 @@ pub fn handle_exit_ingame(server: &mut Server, entity: EcsEntity) { // Note: If other `ServerEvent`s are referring to this entity they will be // disrupted. - // Since we remove `Uid` below, any trades won't be cancelled by `delete_entity_recorded`. So - // we cancel the trade here. (maybe the trade key could be switched from `Uid` to `Entity`) + // Since we remove `Uid` below, any trades won't be cancelled by + // `delete_entity_recorded`. So we cancel the trade here. (maybe the trade + // key could be switched from `Uid` to `Entity`) super::cancel_trades_for(state, entity); let maybe_admin = state.ecs().write_storage::().remove(entity); diff --git a/server/src/lib.rs b/server/src/lib.rs index ecfd922977..c3205fc944 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -1172,11 +1172,8 @@ impl Server { where S: Into, { - if let Some(client) = self.state - .ecs() - .read_storage::() - .get(entity) { - client.send_fallible(msg); + if let Some(client) = self.state.ecs().read_storage::().get(entity) { + client.send_fallible(msg); } }