diff --git a/src/game.cc b/src/game.cc index c606b4e..db7e002 100644 --- a/src/game.cc +++ b/src/game.cc @@ -91,7 +91,7 @@ character *game::move_enemies() { continue; } - if (ch->get_race() == MERCHANT) { + if (the_world && ch->get_race() == MERCHANT) { if (!hostile_merchants) continue; } else if (the_world && diff --git a/src/level.cc b/src/level.cc index 6e3ec90..3c85238 100644 --- a/src/level.cc +++ b/src/level.cc @@ -41,6 +41,12 @@ level::level(const level_data &lvl, character *player, RNG *rng, if (enabled_features & FEATURE_READ_MAP) fill(lvl, tiles, rng); + if (enabled_features & FEATURE_READ_MAP && + (lvl.enemies.size() || + lvl.potions.size() || + lvl.gold_piles.size())) + return; + gen_potions(rng, tiles); gen_gold(rng, tiles); gen_enemies(lvl, rng, tiles); @@ -109,9 +115,9 @@ bool level::is_in_glist(gold &g, const gold_list &gl) { void level::gen_enemies(const level_data &lvl, RNG *rng, std::vector &tiles) { auto dhoard = dragon_hoard(lvl); - int cnt = enabled_features & FEATURE_EXTRA_STUFF ? - rng->rand_between(MIN_ENEMIE_CNT, MAX_ENEMIE_CNT + 1) : - MIN_ENEMIE_CNT + dhoard.size(); + int cnt = (enabled_features & FEATURE_EXTRA_STUFF ? + rng->rand_between(MIN_ENEMIE_CNT, MAX_ENEMIE_CNT + 1) : + MIN_ENEMIE_CNT) + dhoard.size(); elist.reserve(cnt); pelist.reserve(cnt); diff --git a/src/main.cc b/src/main.cc index 3172d54..2bd768d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -29,9 +29,13 @@ int main(int argc, char **argv) { CC3K game_proc(enabled_features, in.get(), out.get(), rng.get(), data); - while (1) + while (true) { if (game_proc.run() == game_status::TERMINATED) break; + if (enabled_features & FEATURE_IN_FILE) + getchar(); + } + return RETURN_FINE; }