mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'ygor/fix-arrow-outcome-loop' into 'master'
Skip physics pass for arrows stuck on surfaces Closes #1094 See merge request veloren/veloren!2183
This commit is contained in:
commit
c2a8153325
@ -562,6 +562,7 @@ impl<'a> PhysicsData<'a> {
|
||||
(
|
||||
positions,
|
||||
velocities,
|
||||
read.stickies.maybe(),
|
||||
&read.bodies,
|
||||
&write.physics_states,
|
||||
&read.masses,
|
||||
@ -574,14 +575,17 @@ impl<'a> PhysicsData<'a> {
|
||||
prof_span!(guard, "velocity update rayon job");
|
||||
guard
|
||||
},
|
||||
|_guard, (pos, vel, body, physics_state, mass, density, _)| {
|
||||
|_guard, (pos, vel, sticky, body, physics_state, mass, density, _)| {
|
||||
let in_loaded_chunk = read
|
||||
.terrain
|
||||
.get_key(read.terrain.pos_key(pos.0.map(|e| e.floor() as i32)))
|
||||
.is_some();
|
||||
|
||||
// Apply physics only if in a loaded chunk
|
||||
if in_loaded_chunk {
|
||||
if in_loaded_chunk
|
||||
// And not already stuck on a block (e.g., for arrows)
|
||||
&& !(physics_state.on_surface().is_some() && sticky.is_some())
|
||||
{
|
||||
// Clamp dt to an effective 10 TPS, to prevent gravity from slamming the
|
||||
// players into the floor when stationary if other systems cause the server
|
||||
// to lag (as observed in the 0.9 release party).
|
||||
|
Loading…
Reference in New Issue
Block a user