Improve asteroid generation performance

This commit is contained in:
Lohikar
2017-03-04 13:49:12 -06:00
parent 76a891930e
commit 4aeab0d6ce
8 changed files with 172 additions and 80 deletions

View File

@@ -1,8 +1,4 @@
#define ORE_COUNT 5000
/*
This module is used to generate the debris fields/distribution maps/procedural stations.
*/
// Generates cave systems for the asteroid, and places ore tiles.
var/global/list/random_maps = list()
var/global/list/map_count = list()
@@ -58,7 +54,7 @@ var/global/list/map_count = list()
var/start_time = world.timeofday
if(!do_not_announce) admin_notice("<span class='danger'>Generating [name].</span>", R_DEBUG)
sleep(-1)
CHECK_TICK
// Testing needed to see how reliable this is (asynchronous calls, called during worldgen), DM ref is not optimistic
if(seed)
@@ -160,7 +156,8 @@ var/global/list/map_count = list()
for(var/x = 1, x <= limit_x, x++)
for(var/y = 1, y <= limit_y, y++)
if(!priority_process) sleep(-1)
if(!priority_process)
CHECK_TICK
apply_to_turf(x,y)
/datum/random_map/proc/apply_to_turf(var/x,var/y)