1
2
Fork 0
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:
mat 2023-12-14 00:28:58 -06:00
parent 1f3266f899
commit b99f0b5845
2 changed files with 3 additions and 3 deletions

View file

@ -48,7 +48,7 @@ where
movement_data: None,
came_from: None,
g_score: f32::default(),
f_score: f32::MAX,
f_score: f32::INFINITY,
},
);

View file

@ -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)
}