Add a lantern strength limit to prevent shader overflows

This commit is contained in:
Piotr Korgól 2019-08-08 14:44:58 +02:00
parent 2eac162ee4
commit 9f2d66b025

View File

@ -658,7 +658,11 @@ fn handle_lantern(server: &mut Server, entity: EcsEntity, args: String, action:
comp::LightEmitter {
offset: Vec3::new(0.5, 0.2, 0.8),
col: Rgb::new(1.0, 0.75, 0.3),
strength: if let Some(s) = opt_s { s.max(0.0) } else { 6.0 },
strength: if let Some(s) = opt_s {
s.max(0.0).min(20.0)
} else {
6.0
},
},
);