summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/include/DataDefs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/include/DataDefs.h b/library/include/DataDefs.h
index 61d5dec4..0966c7f3 100644
--- a/library/include/DataDefs.h
+++ b/library/include/DataDefs.h
@@ -707,6 +707,9 @@ namespace DFHack {
// Global object pointers
#include "df/global_objects.h"
+#define DF_GLOBAL_VALUE(name,defval) (df::global::name ? *df::global::name : defval)
+#define DF_GLOBAL_FIELD(name,fname,defval) (df::global::name ? df::global::name->fname : defval)
+
// A couple of headers that have to be included at once
#include "df/coord2d.h"
#include "df/coord.h"