summaryrefslogtreecommitdiff
path: root/src/game/worldgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/worldgen.cpp')
-rw-r--r--src/game/worldgen.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/game/worldgen.cpp b/src/game/worldgen.cpp
index e5f19c8..18a98b5 100644
--- a/src/game/worldgen.cpp
+++ b/src/game/worldgen.cpp
@@ -13,19 +13,23 @@ void add_decoration(world_t *world, state_t *game, v2f_t x, float noise)
if (noise < 0.3)
return;
- if (noise > 0.5)
- type = DECO_NEST;
- else if (noise > 0.40)
+ offset[0] = world->perlin.get(x, 0.17331f);
+ offset[1] = world->perlin.get(x, 0.19571f);
+ center = x + v2f_t(0.5f, 0.5f) + offset.norm() * 0.1;
+
+ if (noise > 0.5) {
+ unit_nest_t *nest = new unit_nest_t(game);
+ nest->place(world, center);
+ return;
+ }
+
+ if (noise > 0.40)
type = DECO_EYETHING;
else if (noise > 0.35)
type = DECO_STONE;
else
type = DECO_STONE_SMALL;
- offset[0] = world->perlin.get(x, 0.17331f);
- offset[1] = world->perlin.get(x, 0.19571f);
- center = x + v2f_t(0.5f, 0.5f) + offset.norm() * 0.1;
-
deco = new deco_t(game, type);
deco->phase_shift = offset[0] * 500.0;
deco->place(world, x);