//simplified MC that is designed to fail when procs 'break'. When it fails it's just replaced with a new one. //It ensures master_controller.process() is never doubled up by killing the MC (hence terminating any of its sleeping procs) //WIP, needs lots of work still var/global/datum/controller/game_controller/master_controller //Set in world.New() var/global/controller_iteration = 0 var/global/last_tick_timeofday = world.timeofday var/global/last_tick_duration = 0 var/global/air_processing_killed = 0 var/global/pipe_processing_killed = 0 datum/controller/game_controller var/processing = 0 var/breather_ticks = 2 //a somewhat crude attempt to iron over the 'bumps' caused by high-cpu use by letting the MC have a breather for this many ticks after every loop var/minimum_ticks = 20 //The minimum length of time between MC ticks var/air_cost = 0 var/air_turfs = 0 var/air_groups = 0 var/air_highpressure= 0 var/air_hotspots = 0 var/air_superconductivity = 0 var/sun_cost = 0 var/mobs_cost = 0 var/diseases_cost = 0 var/machines_cost = 0 var/objects_cost = 0 var/networks_cost = 0 var/powernets_cost = 0 var/nano_cost = 0 var/events_cost = 0 var/ticker_cost = 0 var/gc_cost = 0 var/total_cost = 0 var/last_thing_processed datum/controller/game_controller/New() //There can be only one master_controller. Out with the old and in with the new. if(master_controller != src) if(istype(master_controller)) Recover() del(master_controller) master_controller = src createRandomZlevel() //probably shouldn't be here! for(var/i=0, i