mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	Check for having pruned all land candidates.
This commit is contained in:
		| @@ -675,7 +675,6 @@ EX eLand getNewLand(eLand old) { | |||||||
|  |  | ||||||
|   if(ls::horodisk_structure() && tortoise::seek()) LIKELY tab[cnt++] = laTortoise; |   if(ls::horodisk_structure() && tortoise::seek()) LIKELY tab[cnt++] = laTortoise; | ||||||
|    |    | ||||||
|   printf("Before pruning: %d entries\n", cnt); |  | ||||||
|   int idx = 0; |   int idx = 0; | ||||||
|   while (idx < cnt) { |   while (idx < cnt) { | ||||||
|     eLand n = tab[idx]; |     eLand n = tab[idx]; | ||||||
| @@ -684,14 +683,16 @@ EX eLand getNewLand(eLand old) { | |||||||
|     else |     else | ||||||
|       idx++; |       idx++; | ||||||
|     } |     } | ||||||
|   printf("After pruning: %d entries\n", cnt); |  | ||||||
|  |   if (!cnt) { | ||||||
|  |     addMessage("No eligible land candidates!"); | ||||||
|  |     return old; | ||||||
|  |     } | ||||||
|  |  | ||||||
|   eLand n = tab[hrand(cnt)]; |   eLand n = tab[hrand(cnt)]; | ||||||
|   if (weirdhyperbolic && specialland == laCrossroads4 && isCrossroads(n)) |   if (weirdhyperbolic && specialland == laCrossroads4 && isCrossroads(n)) | ||||||
|     n = laCrossroads4; |     n = laCrossroads4; | ||||||
|  |  | ||||||
|   //printf("Took %d attempts.\n", attempts); |  | ||||||
|    |  | ||||||
|   return n;   |   return n;   | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jacob Mandelson
					Jacob Mandelson