Added a check that avoids server crash (unhandled exception) when map generation is attempted near limit