town_cmd.c
changeset 4384 7e0d3ed719d9
parent 4357 aaba385fa723
child 4396 28cfaf264db6
equal deleted inserted replaced
4383:f1e2d6c7527e 4384:7e0d3ed719d9
  1060 		if (CreateRandomTown(20, 0) != NULL) num++;
  1060 		if (CreateRandomTown(20, 0) != NULL) num++;
  1061 	} while (--n);
  1061 	} while (--n);
  1062 
  1062 
  1063 	// give it a last try, but now more aggressive
  1063 	// give it a last try, but now more aggressive
  1064 	if (num == 0 && CreateRandomTown(10000, 0) == NULL) {
  1064 	if (num == 0 && CreateRandomTown(10000, 0) == NULL) {
  1065 		if (GetTownArraySize() > 0) return true;
  1065 		if (GetTownArraySize() == 0) {
  1066 
  1066 			/* XXX - can we handle that more gracefully? */
  1067 		//XXX can we handle that more gracefully?
  1067 			if (_game_mode != GM_EDITOR) error("Could not generate any town");
  1068 		if (num == 0 && _game_mode != GM_EDITOR) {
  1068 
  1069 			error("Could not generate any town");
  1069 			return false;
  1070 		}
  1070 		}
  1071 		return false;
       
  1072 	}
  1071 	}
  1073 
  1072 
  1074 	return true;
  1073 	return true;
  1075 }
  1074 }
  1076 
  1075