diff --git a/Memory.xml b/Memory.xml
index a41125537..f651c07df 100644
--- a/Memory.xml
+++ b/Memory.xml
@@ -990,6 +990,17 @@
+
+
+
+
+
+
+
+
+ to what???
+
+
@@ -3029,6 +3040,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 25e4bb2ab..c378115d1 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -75,6 +75,7 @@ modules/Maps.cpp
modules/Materials.cpp
modules/Translation.cpp
modules/Vegetation.cpp
+modules/Vermin.cpp
modules/World.cpp
)
diff --git a/library/Core.cpp b/library/Core.cpp
index ea8d26084..ec1ae20b9 100644
--- a/library/Core.cpp
+++ b/library/Core.cpp
@@ -443,4 +443,5 @@ MODULE_GETTER(Items);
MODULE_GETTER(Translation);
MODULE_GETTER(Vegetation);
MODULE_GETTER(Buildings);
-MODULE_GETTER(Constructions);
\ No newline at end of file
+MODULE_GETTER(Constructions);
+MODULE_GETTER(Vermin);
diff --git a/library/include/dfhack/Core.h b/library/include/dfhack/Core.h
index 1f9615d9e..a74a192fb 100644
--- a/library/include/dfhack/Core.h
+++ b/library/include/dfhack/Core.h
@@ -48,6 +48,7 @@ namespace DFHack
class Vegetation;
class Buildings;
class Constructions;
+ class Vermin;
class VersionInfo;
class VersionInfoFactory;
class Console;
@@ -105,6 +106,8 @@ namespace DFHack
Buildings * getBuildings();
/// get the constructions module
Constructions * getConstructions();
+ /// get the vermin module
+ Vermin * getVermin();
/// sets the current hotkey command
bool setHotkeyCmd( std::string cmd );
/// removes the hotkey command and gives it to the caller thread
@@ -144,6 +147,7 @@ namespace DFHack
Vegetation * pVegetation;
Buildings * pBuildings;
Constructions * pConstructions;
+ Vermin * pVermin;
} s_mods;
std::vector allModules;
DFHack::PluginManager * plug_mgr;
@@ -156,4 +160,4 @@ namespace DFHack
// Very important!
bool started;
};
-}
\ No newline at end of file
+}
diff --git a/library/include/dfhack/modules/Vermin.h b/library/include/dfhack/modules/Vermin.h
new file mode 100644
index 000000000..f5eaac583
--- /dev/null
+++ b/library/include/dfhack/modules/Vermin.h
@@ -0,0 +1,86 @@
+#pragma once
+#ifndef CL_MOD_VERMIN
+#define CL_MOD_VERMIN
+/**
+ * \defgroup grp_vermin Wild vermin (ants, bees, etc)
+ * @ingroup grp_vermin
+ */
+#include "dfhack/Export.h"
+#include "dfhack/Module.h"
+
+#ifdef __cplusplus
+namespace DFHack
+{
+#endif
+ /**
+ * Structure for holding a read DF vermin spawn point object
+ * \ingroup grp_vermin
+ */
+ struct t_spawnPoint
+ {
+ uint32_t origin;
+ uint16_t race;
+ uint16_t type;
+ uint16_t x;
+ uint16_t y;
+ uint16_t z;
+ bool in_use;
+ uint8_t unknown;
+ uint32_t countdown;
+ };
+
+#ifdef __cplusplus
+ class DFContextShared;
+ class SpawnPoints;
+
+ /**
+ * The Vermin module - allows reading DF vermin
+ * \ingroup grp_modules
+ * \ingroup grp_vermin
+ */
+ class DFHACK_EXPORT Vermin : public Module
+ {
+ public:
+ Vermin();
+ ~Vermin();
+
+ bool Finish();
+
+ // NOTE: caller must call delete on result when done.
+ SpawnPoints* getSpawnPoints();
+
+ private:
+ struct Private;
+ Private *d;
+
+ friend class SpawnPoints;
+ };
+
+ class DFHACK_EXPORT SpawnPoints
+ {
+ public:
+ static const uint16_t TYPE_WILD_COLONY = 0xFFFF;
+
+ protected:
+ SpawnPoints(Vermin * v);
+
+ public:
+ ~SpawnPoints();
+
+ size_t size();
+ bool Read (const uint32_t index, t_spawnPoint & point);
+ bool Write (const uint32_t index, t_spawnPoint & point);
+ bool isValid();
+
+ static bool isWildColony(t_spawnPoint & point);
+
+ private:
+ Vermin* v;
+ std::vector * p_sp;
+
+ friend class Vermin;
+ };
+}
+#endif // __cplusplus
+
+#endif
diff --git a/library/modules/Vermin.cpp b/library/modules/Vermin.cpp
new file mode 100644
index 000000000..67fd623e4
--- /dev/null
+++ b/library/modules/Vermin.cpp
@@ -0,0 +1,191 @@
+/*
+www.sourceforge.net/projects/dfhack
+Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+*/
+
+#include "Internal.h"
+
+#include
+#include
+#include