diff --git a/Memory.xml b/Memory.xml
index 1f19a8c4b..bf7507cb4 100644
--- a/Memory.xml
+++ b/Memory.xml
@@ -760,6 +760,7 @@
+
@@ -2095,7 +2096,38 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -->
+
+
+
+
.-"""-.
' \
|,. ,-. | _________________________
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 826576259..f40601909 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -184,7 +184,8 @@ SET_TARGET_PROPERTIES(dfhack PROPERTIES DEBUG_POSTFIX "-debug" )
TARGET_LINK_LIBRARIES(dfhack ${PROJECT_LIBS})
-ADD_CUSTOM_COMMAND( TARGET dfhack POST_BUILD
+#ADD_CUSTOM_COMMAND( TARGET dfhack POST_BUILD
+ADD_CUSTOM_TARGET( memxmlcopy ALL
COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/Memory.xml ${dfhack_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/)
install(TARGETS dfhack
diff --git a/library/include/dfhack/modules/Maps.h b/library/include/dfhack/modules/Maps.h
index 30945f313..d2fed2ffb 100644
--- a/library/include/dfhack/modules/Maps.h
+++ b/library/include/dfhack/modules/Maps.h
@@ -475,6 +475,7 @@ namespace DFHack
int16_t global_feature;
/// index into the local feature vector... complicated
int16_t local_feature;
+ int32_t mystery;
} mapblock40d;
class DFContextShared;
diff --git a/library/modules/Maps.cpp b/library/modules/Maps.cpp
index ab8f4d7cc..c4449c3bb 100644
--- a/library/modules/Maps.cpp
+++ b/library/modules/Maps.cpp
@@ -85,6 +85,7 @@ struct Maps::Private
uint32_t temperature2_offset;
uint32_t global_feature_offset;
uint32_t local_feature_offset;
+ uint32_t mystery;
uint32_t vein_mineral_vptr;
uint32_t vein_ice_vptr;
@@ -198,7 +199,14 @@ Maps::Maps(DFContextShared* _d)
off.temperature1_offset = OG_MapBlock->getOffset ("temperature1");
off.temperature2_offset = OG_MapBlock->getOffset ("temperature2");
}
-
+ try
+ {
+ off.mystery = OG_MapBlock->getOffset ("mystery_offset");
+ }
+ catch(Error::AllMemdef &)
+ {
+ off.mystery = 0;
+ }
try
{
OffsetGroup *OG_Geology = OG_Maps->getGroup("geology");
@@ -314,6 +322,8 @@ bool Maps::Start()
// test for wrong map dimensions
if (mx == 0 || mx > 48 || my == 0 || my > 48 || mz == 0)
{
+ cout << hex << off.x_count_offset << " " << off.y_count_offset << " " << off.z_count_offset << endl;
+ cout << dec << mx << " "<< my << " "<< mz << endl;
throw Error::BadMapDimensions(mx, my);
//return false;
}
@@ -408,6 +418,7 @@ bool Maps::ReadBlock40d(uint32_t x, uint32_t y, uint32_t z, mapblock40d * buffer
p->read (addr + d->offsets.biome_stuffs, sizeof (biome_indices40d), (uint8_t *) buffer->biome_indices);
p->readWord(addr + d->offsets.global_feature_offset, (uint16_t&) buffer->global_feature);
p->readWord(addr + d->offsets.local_feature_offset, (uint16_t&)buffer->local_feature);
+ p->readDWord(addr + d->offsets.mystery, (uint32_t&)buffer->mystery);
buffer->origin = addr;
uint32_t addr_of_struct = p->readDWord(addr);
buffer->blockflags.whole = p->readDWord(addr_of_struct);
diff --git a/tools/supported/probe.cpp b/tools/supported/probe.cpp
index 71d5c15f8..ddbcf8bcf 100644
--- a/tools/supported/probe.cpp
+++ b/tools/supported/probe.cpp
@@ -159,8 +159,10 @@ int main (int numargs, const char ** args)
sa_feature(global_features[block.global_feature].type)
);
}
-
#undef PRINT_FLAG
+ cout << "local feature idx: " << block.local_feature << endl;
+ cout << "global feature idx: " << block.global_feature << endl;
+ cout << "mystery: " << block.mystery << endl;
std::cout << std::endl;
}
}