@@ -48,7 +48,7 @@ fn parkour_forward_1_move(edges: &mut Vec<Edge>, ctx: &PathfinderCtx, pos: Block
48
48
continue ;
49
49
}
50
50
51
- let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 2. ;
51
+ let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 2. + CENTER_AFTER_FALL_COST ;
52
52
53
53
edges. push ( Edge {
54
54
movement : astar:: Movement {
@@ -102,7 +102,7 @@ fn parkour_forward_2_move(edges: &mut Vec<Edge>, ctx: &PathfinderCtx, pos: Block
102
102
continue ;
103
103
}
104
104
105
- let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 3. ;
105
+ let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 3. + CENTER_AFTER_FALL_COST ;
106
106
107
107
edges. push ( Edge {
108
108
movement : astar:: Movement {
@@ -132,11 +132,7 @@ fn parkour_forward_3_move(edges: &mut Vec<Edge>, ctx: &PathfinderCtx, pos: Block
132
132
continue ;
133
133
}
134
134
135
- let ascend: i32 = if ctx. is_standable ( pos + offset. up ( 1 ) ) {
136
- 1
137
- } else if ctx. is_standable ( pos + offset) {
138
- 0
139
- } else {
135
+ if !ctx. is_standable ( pos + offset) {
140
136
continue ;
141
137
} ;
142
138
@@ -158,11 +154,11 @@ fn parkour_forward_3_move(edges: &mut Vec<Edge>, ctx: &PathfinderCtx, pos: Block
158
154
continue ;
159
155
}
160
156
161
- let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 3. ;
157
+ let cost = JUMP_PENALTY + SPRINT_ONE_BLOCK_COST * 4. + CENTER_AFTER_FALL_COST ;
162
158
163
159
edges. push ( Edge {
164
160
movement : astar:: Movement {
165
- target : pos + offset. up ( ascend ) ,
161
+ target : pos + offset,
166
162
data : MoveData {
167
163
execute : & execute_parkour_move,
168
164
is_reached : & default_is_reached,
@@ -237,8 +233,6 @@ pub fn parkour_is_reached(
237
233
position, target, ..
238
234
} : IsReachedCtx ,
239
235
) -> bool {
240
- let target_center = target. center ( ) ;
241
-
242
236
// 0.094 and not 0 for lilypads
243
237
BlockPos :: from ( position) == target && ( position. y - target. y as f64 ) < 0.094
244
238
}
0 commit comments