Skip to content

Commit dba146a

Browse files
committed
worldgen fixed!
1 parent c17ed33 commit dba146a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/mapgen.ml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ let add_mountains_list r area =
6363
match area with
6464
| EastUS -> 157 - y/3
6565
| WestUS ->
66-
if y mod 4 = 0 && y <= 144 && y <= 50 then
66+
if y mod 4 = 0 && y <= 144 && y >= 50 then
6767
y / 5 + 36
6868
else
6969
y / 5 + 96
@@ -73,12 +73,13 @@ let add_mountains_list r area =
7373
let delta_x = Random.int 100 r in
7474
(* Bring closer to 0 *)
7575
let x = if x >= 0 then x - delta_x else x + delta_x in
76-
let a, b = match area with
77-
| EastUS -> (x * 200, 400 - y)
78-
| WestUS -> (x * 32, 200 - formula)
76+
let x = match area with
77+
| EastUS ->
78+
(200 * x) / (400 - y) + formula
79+
| WestUS ->
80+
(32 * x) / (200 - formula) + formula
7981
| _ -> assert false
8082
in
81-
let x = a / b + formula in
8283
let x, y =
8384
if y < 80 then
8485
let y = y - Random.int 35 r in (* move up *)

0 commit comments

Comments
 (0)