mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix accidental jump cancellation during dispatch of NpcActivity::Goto
`AgentData::jump_if` cancels `InputKind::Jump` if condition is not met. Even if the jump itself was issued elsewhere. This prevented merchants and travelers from reaching target site if somewhere along the path jump is required. This is exactly what happens during dispatch of `NpcActivity::Goto`. Original implementation contained `traverse` followed by `jump_if` for flying NPCs which cancelled pending `InputKind::Jump` issued by `traverse`. This fix extends jump condition inside traverse by including `traversal_config.can_fly`.
This commit is contained in:
parent
d8bd81357b
commit
45916d1794
@ -165,7 +165,7 @@ impl<'a> AgentData<'a> {
|
||||
let climbing_out_of_water = self.physics_state.in_liquid().map_or(false, |h| h < 1.0)
|
||||
&& bearing.z > 0.0
|
||||
&& self.physics_state.on_wall.is_some();
|
||||
self.jump_if(bearing.z > 1.5 || climbing_out_of_water, controller);
|
||||
self.jump_if(bearing.z > 1.5 || climbing_out_of_water || self.traversal_config.can_fly, controller);
|
||||
controller.inputs.move_z = bearing.z;
|
||||
if bearing.z > 0.0 {
|
||||
controller.inputs.climb = Some(comp::Climb::Up);
|
||||
@ -285,7 +285,6 @@ impl<'a> AgentData<'a> {
|
||||
},
|
||||
) {
|
||||
self.traverse(controller, bearing, speed.min(speed_factor));
|
||||
self.jump_if(self.traversal_config.can_fly, controller);
|
||||
|
||||
let height_offset = bearing.z
|
||||
+ if self.traversal_config.can_fly {
|
||||
|
Loading…
x
Reference in New Issue
Block a user