From 3f31f07cc29efd3b6512857e4cc5e742f3126359 Mon Sep 17 00:00:00 2001 From: Aleksandr Nariadchikov Date: Mon, 6 Sep 2021 20:33:08 +0300 Subject: [PATCH] [#1251] Code style refactoring --- server/src/cmd.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/server/src/cmd.rs b/server/src/cmd.rs index db6c23c485..2f395fb284 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -55,8 +55,8 @@ use vek::*; use wiring::{Circuit, Wire, WiringAction, WiringActionEffect, WiringElement}; use world::util::Sampler; -use tracing::{error, info, warn}; use common::comp::Alignment; +use tracing::{error, info, warn}; pub trait ChatCommandExt { fn execute(&self, server: &mut Server, entity: EcsEntity, args: Vec); @@ -1682,15 +1682,14 @@ fn handle_kill_npcs( let alignments = ecs.read_storage::(); let mut count = 0; - for (mut health, (), alignment) - in (&mut healths, !&players, alignments.maybe()).join() { - let should_kill = kill_pets || - if let Some(Alignment::Owned(owned)) = alignment { - ecs.entity_from_uid(owned.0) - .map_or(true, |owner| !players.contains(owner)) - } else { - true - }; + for (mut health, (), alignment) in (&mut healths, !&players, alignments.maybe()).join() { + let should_kill = kill_pets + || if let Some(Alignment::Owned(owned)) = alignment { + ecs.entity_from_uid(owned.0) + .map_or(true, |owner| !players.contains(owner)) + } else { + true + }; if should_kill { count += 1;