Skip to content

Commit

Permalink
Restore usage for non random configs
Browse files Browse the repository at this point in the history
  • Loading branch information
iMilchshake committed Dec 17, 2024
1 parent 6e82a34 commit 159ced4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl GenerationConfig {
.iter()
.min()
.unwrap();
if (min_inner_size + min_outer_margin) <= 3 {
if (min_inner_size + min_outer_margin) < 3 {
return Err("kernel inner+outer must be at least 3");
}

Expand Down Expand Up @@ -375,7 +375,7 @@ impl GenerationConfig {

/// This function defines the initial default config for actual map generator
pub fn get_initial_gen_config() -> GenerationConfig {
if let Some(file) = GenerationConfigStorage::get("hardV2.json") {
if let Some(file) = GenerationConfigStorage::get("hard_stable.json") {
if let Ok(data) = std::str::from_utf8(&file.data) {
if let Ok(config) = serde_json::from_str(data) {
return config;
Expand Down
18 changes: 8 additions & 10 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,14 @@ impl Editor {

if is_key_pressed(KeyCode::Space) {
self.retry_on_failure = is_key_down(KeyCode::LeftShift);
// TODO: REVERT LOL
let mut new_config;
while {
new_config = GenerationConfig::random(&mut self.gen.rnd);
new_config.validate()
}
.is_err()
{}

self.gen_config = new_config;
// let mut new_config;
// while {
// new_config = GenerationConfig::random(&mut self.gen.rnd);
// new_config.validate()
// }
// .is_err()
// {}
// self.gen_config = new_config;
self.set_playing();
}

Expand Down
2 changes: 1 addition & 1 deletion src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
walker::CuteWalker,
};

const PRINT_TIMES: bool = true;
const PRINT_TIMES: bool = false;

pub fn print_time(timer: &Timer, message: &str) {
// TODO: add cli flag for this
Expand Down

0 comments on commit 159ced4

Please sign in to comment.