This commit is contained in:
Joshua Barretto 2020-09-03 19:06:06 +01:00
parent 798e9d7cd7
commit 0c0f150140
3 changed files with 8 additions and 14 deletions

View File

@ -7,11 +7,7 @@ pub enum DayPeriod {
}
impl DayPeriod {
pub fn is_dark(&self) -> bool {
*self == DayPeriod::Night
}
pub fn is_dark(&self) -> bool { *self == DayPeriod::Night }
pub fn is_light(&self) -> bool {
!self.is_dark()
}
pub fn is_light(&self) -> bool { !self.is_dark() }
}

View File

@ -1,8 +1,8 @@
use crate::{sys, Server, StateExt};
use common::{
comp::{
self, Agent, Alignment, Body, Gravity, Item, ItemDrop, LightEmitter,
Loadout, Pos, Projectile, Scale, Stats, Vel, WaypointArea,
self, Agent, Alignment, Body, Gravity, Item, ItemDrop, LightEmitter, Loadout, Pos,
Projectile, Scale, Stats, Vel, WaypointArea,
},
outcome::Outcome,
util::Dir,

View File

@ -364,15 +364,13 @@ impl FigureMgr {
// TODO: Pending review in #587
pub fn update_lighting(&mut self, scene_data: &SceneData) {
let ecs = scene_data.state.ecs();
for (
entity,
body,
light_emitter,
) in (
for (entity, body, light_emitter) in (
&ecs.entities(),
ecs.read_storage::<common::comp::Body>().maybe(),
&ecs.read_storage::<LightEmitter>(),
).join() {
)
.join()
{
// Add LightAnimation for objects with a LightEmitter
let mut anim_storage = ecs.write_storage::<LightAnimation>();
if let None = anim_storage.get_mut(entity) {