mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
[#1251] Code style refactoring
This commit is contained in:
parent
c22104ea56
commit
3f31f07cc2
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user