slow down chunk ops while loading

This commit is contained in:
griffi-gh 2023-02-10 02:44:17 +01:00
parent 41d7803a64
commit 1c2557d83f

View file

@ -14,8 +14,8 @@ use super::{
tasks::{ChunkTaskManager, ChunkTaskResponse, ChunkTask}, tasks::{ChunkTaskManager, ChunkTaskResponse, ChunkTask},
}; };
//todo limit task starts insted const MAX_CHUNK_OPS_INGAME: usize = 6;
const MAX_CHUNK_OPS: usize = 8; const MAX_CHUNK_OPS: usize = 32;
pub fn update_loaded_world_around_player() -> Workload { pub fn update_loaded_world_around_player() -> Workload {
( (
@ -233,8 +233,9 @@ fn process_completed_tasks(
ops += 1; ops += 1;
} }
} }
if (ops >= MAX_CHUNK_OPS) && matches!(*state, GameState::InGame) { if ops >= match *state {
break GameState::InGame => MAX_CHUNK_OPS_INGAME,
} _ => MAX_CHUNK_OPS,
} { break }
} }
} }