Minimal implementation of server-authoritative physics.

This commit is contained in:
Avi Weinstock 2021-04-01 15:32:15 -04:00
parent a386a27411
commit d6f4537d39
2 changed files with 3 additions and 3 deletions

View File

@ -216,7 +216,7 @@ impl<'a> System<'a> for Sys {
// Decide how regularly to send physics updates.
let send_now = if client_entity == &entity {
// Don't send client physics updates about itself unless force update is set
force_update.is_some()
force_update.is_some() || true
} else if matches!(collider, Some(Collider::Voxel { .. })) {
// Things with a voxel collider (airships, etc.) need to have very stable
// physics so we always send updated for these where

View File

@ -93,14 +93,14 @@ impl Sys {
}
},
ClientGeneral::PlayerPhysics { pos, vel, ori } => {
if matches!(presence.kind, PresenceKind::Character(_))
/*if matches!(presence.kind, PresenceKind::Character(_))
&& force_updates.get(entity).is_none()
&& healths.get(entity).map_or(true, |h| !h.is_dead)
{
let _ = positions.insert(entity, pos);
let _ = velocities.insert(entity, vel);
let _ = orientations.insert(entity, ori);
}
}*/
},
ClientGeneral::BreakBlock(pos) => {
if let Some(comp_can_build) = can_build.get(entity) {