summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/acr.cc10
-rw-r--r--crawl-ref/source/clua.cc2
-rw-r--r--crawl-ref/source/clua.h1
-rw-r--r--crawl-ref/source/luadgn.cc3
-rw-r--r--crawl-ref/source/luadgn.h1
5 files changed, 11 insertions, 6 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index c7581c92d1..1e3a6c7bff 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -140,11 +140,19 @@
#include "tiles.h"
-crawl_environment env;
+// ----------------------------------------------------------------------
+// Globals whose construction/destruction order needs to be managed
+// ----------------------------------------------------------------------
+
+CLua clua(true);
+CLua dlua(false); // Lua interpreter for the dungeon builder.
+crawl_environment env; // Requires dlua
player you;
system_environment SysEnv;
game_state crawl_state;
+
+
std::string init_file_location; // externed in newgame.cc
char info[ INFO_SIZE ]; // messaging queue extern'd everywhere {dlb}
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index 1f1f7e3a5e..d132023f9d 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -68,8 +68,6 @@ static int clua_guarded_pcall(lua_State *);
static int clua_dofile(lua_State *);
static int clua_loadfile(lua_State *);
-CLua clua(true);
-
const int CLua::MAX_THROTTLE_SLEEPS;
CLua::CLua(bool managed)
diff --git a/crawl-ref/source/clua.h b/crawl-ref/source/clua.h
index 7608717e6a..51d827d183 100644
--- a/crawl-ref/source/clua.h
+++ b/crawl-ref/source/clua.h
@@ -183,6 +183,7 @@ private:
static std::string new_fn_name();
};
+// Defined in acr.cc
extern CLua clua;
void lua_set_exclusive_item(const item_def *item = NULL);
diff --git a/crawl-ref/source/luadgn.cc b/crawl-ref/source/luadgn.cc
index 88ece19f78..7cbf853697 100644
--- a/crawl-ref/source/luadgn.cc
+++ b/crawl-ref/source/luadgn.cc
@@ -29,9 +29,6 @@
#include "terrain.h"
#include "view.h"
-// Lua interpreter for the dungeon builder.
-CLua dlua(false);
-
template <typename list, typename lpush>
static int dlua_gentable(lua_State *ls, const list &strings, lpush push)
{
diff --git a/crawl-ref/source/luadgn.h b/crawl-ref/source/luadgn.h
index 7b74f38621..f0b92af987 100644
--- a/crawl-ref/source/luadgn.h
+++ b/crawl-ref/source/luadgn.h
@@ -12,6 +12,7 @@
#include "AppHdr.h"
#include "clua.h"
+// Defined in acr.cc
extern CLua dlua;
// Lua chunks cannot exceed 512K. Which is plenty!