[#1251] Code style refactoring

This commit is contained in:
Aleksandr Nariadchikov 2021-09-06 20:33:08 +03:00
parent c22104ea56
commit 3f31f07cc2

View File

@ -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<String>);
@ -1682,10 +1682,9 @@ fn handle_kill_npcs(
let alignments = ecs.read_storage::<comp::Alignment>();
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 {
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 {