Refactored city generation loop to remove repetitive code.
Merge pull request #6525 from kevingranade/refactor-citygen

Refactored city generation loop to remove repetitive code.