Make falldamage local, don't use force update for local, cleanup

This commit is contained in:
timokoesters
2019-08-25 20:31:56 +02:00
parent eb34e5bb27
commit 05f2f168fd
4 changed files with 17 additions and 29 deletions

View File

@ -243,19 +243,6 @@ impl Server {
let clients = &mut self.clients;
match event {
ServerEvent::LandOnGround { entity, vel } => {
if let Some(stats) = state
.ecs_mut()
.write_storage::<comp::Stats>()
.get_mut(entity)
{
let falldmg = (vel.z / 1.5 + 10.0) as i32;
if falldmg < 0 {
stats.health.change_by(falldmg, comp::HealthSource::World);
}
}
}
ServerEvent::Explosion { pos, radius } => {
const RAYS: usize = 500;