Skip to content

Commit

Permalink
Fix initialisation order of global_init and other global vars
Browse files Browse the repository at this point in the history
  • Loading branch information
GinjaNinja32 authored and Ccomp5950 committed Jun 7, 2016
1 parent 9c043e0 commit 558a44f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Expand Up @@ -2036,4 +2036,5 @@
#include "maps\exodus\exodus_define.dm"
#include "maps\torch\torch_define.dm"
#include "maps\~mapsystem\maps.dm"
#include "~code\global_init.dm"
// END_INCLUDE
30 changes: 0 additions & 30 deletions code/world.dm
@@ -1,34 +1,4 @@

/*
The initialization of the game happens roughly like this:
1. All global variables are initialized (including the global_init instance).
2. The map is initialized, and map objects are created.
3. world/New() runs, creating the process scheduler (and the old master controller) and spawning their setup.
4. processScheduler/setup() runs, creating all the processes. game_controller/setup() runs, calling initialize() on all movable atoms in the world.
5. The gameticker is created.
*/
var/global/datum/global_init/init = new ()

/*
Pre-map initialization stuff should go here.
*/
/datum/global_init/New()
generate_gameid()

makeDatumRefLists()
populateGlobalLists()
load_configuration()

initialize_chemical_reagents()
initialize_chemical_reactions()

qdel(src) //we're done

/datum/global_init/Destroy()
return 1

/var/game_id = null
/proc/generate_gameid()
if(game_id != null)
Expand Down
29 changes: 29 additions & 0 deletions ~code/global_init.dm
@@ -0,0 +1,29 @@
/*
The initialization of the game happens roughly like this:
1. All global variables are initialized (including the global_init instance$
2. The map is initialized, and map objects are created.
3. world/New() runs, creating the process scheduler (and the old master con$
4. processScheduler/setup() runs, creating all the processes. game_controll$
5. The gameticker is created.
*/

var/global/datum/global_init/init = new ()

/*
Pre-map initialization stuff should go here.
*/
/datum/global_init/New()
generate_gameid()

makeDatumRefLists()
populateGlobalLists()
load_configuration()

initialize_chemical_reagents()
initialize_chemical_reactions()

qdel(src) //we're done

/datum/global_init/Destroy()
return 1

0 comments on commit 558a44f

Please sign in to comment.