Skip to content

Commit

Permalink
fix bad map
Browse files Browse the repository at this point in the history
  • Loading branch information
orangeryang committed Oct 16, 2023
1 parent c87ee63 commit ee3e473
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts-starknet/src/dungeons_generator.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,12 @@ fn generate_entities(seed: u256, size: u128) -> (Pack, Pack) {
)
} else {
let mut cavern: Pack = generate_cavern(ref settings);
let num_tiles = cavern.count_bit();
let mut num_tiles = cavern.count_bit();

// to avoid calculation error
if num_tiles <= 6 {
num_tiles = 7;
}

let mut points: Pack = generate_points(
ref settings, ref cavern, 12 / square_root(num_tiles - 6)
Expand Down

0 comments on commit ee3e473

Please sign in to comment.