(svn r6137) -Codechange: some very minor cleanups:

- Start using DeleteXXX for every pool item, not manually doing it
  - Use some wrapper to improve logic
  - Rewrote some pieces to improve logic
This commit is contained in:
truelight
2006-08-26 14:22:54 +00:00
parent bd775a243d
commit 44e5e7f0e4
9 changed files with 60 additions and 42 deletions

View File

@@ -1062,13 +1062,12 @@ bool GenerateTowns(void)
// give it a last try, but now more aggressive
if (num == 0 && CreateRandomTown(10000, 0) == NULL) {
if (GetTownArraySize() > 0) return true;
if (GetTownArraySize() == 0) {
/* XXX - can we handle that more gracefully? */
if (_game_mode != GM_EDITOR) error("Could not generate any town");
//XXX can we handle that more gracefully?
if (num == 0 && _game_mode != GM_EDITOR) {
error("Could not generate any town");
return false;
}
return false;
}
return true;