From 581d1bae1214284cab3d40b72b6a57763a855fb7 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 8 Aug 2020 13:34:02 +0200 Subject: [PATCH] fairland: Tweak progress messages "fairland: unstable drift -- try increasing DRIFT_MAX" is confusing: it looks like an error, but isn't, and increasing DRIFT_MAX requires a recompile. I'm not sure it can happen. Replace by just "unstable drift". "fairland: error -- continent %c had no room to grow!" is pretty redundant: it's always followed by "Only managed to grow %d out of %d sectors." and then "ERROR: World not large enough to hold continents". All it adds is which of the continents failed to grow, and that's not actionable. Drop the message. The message sequence "designating sectors...", "adding resources...", "setting coastal flags...", and "writing to sectors file..." is a bit of a lie as these four tasks aren't actually done one after the other. Replace by just "writing to sectors file..." Signed-off-by: Markus Armbruster --- src/util/fairland.c | 14 ++++---------- tests/fairland/no-spike.out | 3 --- tests/fairland/plain.out | 3 --- tests/fairland/spike.out | 3 --- tests/fairland/stunted.out | 5 ----- 5 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/util/fairland.c b/src/util/fairland.c index c3ef00d1..b01ddb25 100644 --- a/src/util/fairland.c +++ b/src/util/fairland.c @@ -294,7 +294,7 @@ main(int argc, char *argv[]) qprint("\ntry #%d (out of %d)...\n", i + 1, NUMTRIES); qprint("placing capitals...\n"); if (!drift()) - qprint("fairland: unstable drift -- try increasing DRIFT_MAX\n"); + qprint("unstable drift\n"); qprint("growing continents...\n"); grow_continents(); } while (fl_status && ++i < NUMTRIES); @@ -307,11 +307,10 @@ main(int argc, char *argv[]) grow_islands(); qprint("\nelevating land...\n"); create_elevations(); - qprint("designating sectors...\n"); - qprint("adding resources...\n"); + + qprint("writing to sectors file...\n"); if (!write_newcap_script()) exit(1); - if (chdir(gamedir)) { fprintf(stderr, "Can't chdir to %s (%s)\n", gamedir, strerror(errno)); exit(EXIT_FAILURE); @@ -319,7 +318,6 @@ main(int argc, char *argv[]) if (!ef_open(EF_SECTOR, EFF_MEM | EFF_NOTIME)) exit(1); write_sects(); - qprint("writing to sectors file...\n"); if (!ef_close(EF_SECTOR)) exit(1); @@ -761,11 +759,8 @@ grow_one_sector(int c) ++coast_search; } while (!done && coast_search < COAST_SEARCH_MAX && (secs == 1 || x != sx || y != sy)); - if (!done && c < nc) { - qprint("fairland: error -- continent %c had no room to grow!\n", - numletter[c % 62]); + if (!done && c < nc) fl_status |= STATUS_NO_ROOM; - } return done; } @@ -1266,7 +1261,6 @@ set_coastal_flags(void) int i, j; struct sctstr *sp; - qprint("setting coastal flags...\n"); for (i = 0; i < nc; ++i) { for (j = 0; j < sc; j++) { sp = getsectp(sectx[i][j], secty[i][j]); diff --git a/tests/fairland/no-spike.out b/tests/fairland/no-spike.out index 9c629fb4..472de3fe 100644 --- a/tests/fairland/no-spike.out +++ b/tests/fairland/no-spike.out @@ -17,9 +17,6 @@ placing capitals... growing continents... growing islands: 1(3) 2(8) 3(13) 4(7) 5(10) 6(10) 7(2) 8(8) 9(14) 10(17) 11(13) 12(15) 13(9) 14(8) 15(3) elevating land... -designating sectors... -adding resources... -setting coastal flags... writing to sectors file... . . . % . . . % . . . . . . . . % % . % . . . . . . . . . . . . diff --git a/tests/fairland/plain.out b/tests/fairland/plain.out index b8ab267a..20f8bcac 100644 --- a/tests/fairland/plain.out +++ b/tests/fairland/plain.out @@ -17,9 +17,6 @@ placing capitals... growing continents... growing islands: 1(15) 2(21) 3(11) 4(13) 5(9) elevating land... -designating sectors... -adding resources... -setting coastal flags... writing to sectors file... . . . . . . . . . . . . . . . . . . # # # . . . . . . . . . . . diff --git a/tests/fairland/spike.out b/tests/fairland/spike.out index 9efb3928..b641431a 100644 --- a/tests/fairland/spike.out +++ b/tests/fairland/spike.out @@ -17,9 +17,6 @@ placing capitals... growing continents... growing islands: 1(30) 2(10) 3(26) 4(22) 5(20) 6(16) 7(29) 8(6) elevating land... -designating sectors... -adding resources... -setting coastal flags... writing to sectors file... . b b # # # . . . . % % . . . # . % % ^ % . . . . . . . . . . . diff --git a/tests/fairland/stunted.out b/tests/fairland/stunted.out index 6e1b6ede..fc3eb3f5 100644 --- a/tests/fairland/stunted.out +++ b/tests/fairland/stunted.out @@ -15,13 +15,11 @@ World dimensions: 64x32 seed is 1 placing capitals... growing continents... -fairland: error -- continent h had no room to grow! Only managed to grow 33 out of 37 sectors. try #2 (out of 10)... placing capitals... growing continents... -fairland: error -- continent h had no room to grow! Only managed to grow 31 out of 37 sectors. try #3 (out of 10)... @@ -29,9 +27,6 @@ placing capitals... growing continents... growing islands: 1(14) 2(20) 3(11) 4(16) 5(14) 6(8) 7(2) 8(3) 9(4) 10(5) 11(14) 12(3) elevating land... -designating sectors... -adding resources... -setting coastal flags... writing to sectors file... . . # # # # . . % . . . . % % % % . . . . . . # # # # # # . . %