From c25e1dbdd1dfb31f07cf4dacb8d0f54a924c5108 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 29 Oct 2017 12:20:06 +0100 Subject: [PATCH] improved tryagain -- more tries if necessary, less tries if not --- complex.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/complex.cpp b/complex.cpp index eada6ad0..4ec95a5f 100644 --- a/complex.cpp +++ b/complex.cpp @@ -3063,6 +3063,7 @@ namespace windmap { } int tries = 0; + int maxtries = specialland == laVolcano || specialland == laWhirlwind || chaosmode ? 20 : 1; tryagain: for(int i=0; i> 6]++; for(int u=0; u<4; u++) if(!ingroup[u]) { tries++; - if(tries < 5) goto tryagain; + if(tries < maxtries) goto tryagain; } - if(tries >= 5) { + if(tries >= maxtries && maxtries >= 20) { addMessage("Failed to generate an interesting wind/lava pattern."); } - - if(true) { + else if(false) { printf("tocheck size = %d\n", size(tocheck)); printf("if(N == %d) {\n", N); printf(" windcodes = {");