mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
consistently use f32::INFINITY
this brings performance much closer to how it was before
This commit is contained in:
parent
1f3266f899
commit
b99f0b5845
2 changed files with 3 additions and 3 deletions
|
@ -48,7 +48,7 @@ where
|
|||
movement_data: None,
|
||||
came_from: None,
|
||||
g_score: f32::default(),
|
||||
f_score: f32::MAX,
|
||||
f_score: f32::INFINITY,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ impl CachedWorld {
|
|||
// the chunk isn't loaded
|
||||
if self.is_block_solid(pos) {
|
||||
// assume it's unbreakable if it's solid and out of render distance
|
||||
return f32::MAX;
|
||||
return f32::INFINITY;
|
||||
} else {
|
||||
return 0.;
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ impl CachedWorld {
|
|||
|
||||
pub fn cost_for_standing(&self, pos: BlockPos, mining_cache: &MiningCache) -> f32 {
|
||||
if !self.is_block_solid(pos.down(1)) {
|
||||
return f32::MAX;
|
||||
return f32::INFINITY;
|
||||
}
|
||||
self.cost_for_passing(pos, mining_cache)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue