diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3cbbe6a1f..1cbf9ed24 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,11 @@ endif(CMAKE_CONFIGURATION_TYPES)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(dfhack)
+if(MSVC)
+# disable C4819 code-page warning
+add_definitions( "/wd4819" )
+endif()
+
# set up folder structures for IDE solutions
# MSVC Express won't load solutions that use this. It also doesn't include MFC supported
# Check for MFC!
@@ -58,9 +63,9 @@ set(DF_VERSION_MINOR "34")
set(DF_VERSION_PATCH "07")
set(DF_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}")
-set(DFHACK_RELEASE "1")
+SET(DFHACK_RELEASE "r1" CACHE STRING "Current release revision.")
-set(DFHACK_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}-r${DFHACK_RELEASE}")
+set(DFHACK_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}-${DFHACK_RELEASE}")
add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}")
## where to install things (after the build is done, classic 'make install' or package structure)
diff --git a/LUA_API.rst b/LUA_API.rst
index fc86070c3..d5af5e7a4 100644
--- a/LUA_API.rst
+++ b/LUA_API.rst
@@ -663,6 +663,14 @@ Job module
Units module
------------
+* ``dfhack.units.getPosition(unit)``
+
+ Returns true *x,y,z* of the unit; may be not equal to unit.pos if caged.
+
+* ``dfhack.units.getContainer(unit)``
+
+ Returns the container (cage) item or *nil*.
+
* ``dfhack.units.setNickname(unit,nick)``
Sets the unit's nickname properly.
@@ -687,6 +695,10 @@ Units module
The unit is capable of rational action, i.e. not dead, insane or zombie.
+* ``dfhack.units.clearBurrowMembers(burrow)``
+
+ Removes all units from the burrow.
+
* ``dfhack.units.isInBurrow(unit,burrow)``
Checks if the unit is in the burrow.
@@ -699,6 +711,10 @@ Units module
Items module
------------
+* ``dfhack.items.getPosition(item)``
+
+ Returns true *x,y,z* of the item; may be not equal to item.pos if in inventory.
+
* ``dfhack.items.getOwner(item)``
Returns the owner unit or *nil*.
@@ -708,6 +724,22 @@ Items module
Replaces the owner of the item. If unit is *nil*, removes ownership.
Returns *false* in case of error.
+* ``dfhack.items.getContainer(item)``
+
+ Returns the container item or *nil*.
+
+* ``dfhack.items.getContainedItems(item)``
+
+ Returns a list of items contained in this one.
+
+* ``dfhack.items.moveToGround(item,pos)``
+
+ Move the item to the ground at position. Returns *false* if impossible.
+
+* ``dfhack.items.moveToContainer(item,container)``
+
+ Move the item to the container. Returns *false* if impossible.
+
Maps module
-----------
@@ -748,6 +780,10 @@ Maps module
Returns a table of map block pointers.
+* ``dfhack.maps.clearBurrowTiles(burrow)``
+
+ Removes all tiles from the burrow.
+
* ``dfhack.maps.isBurrowTile(burrow,tile_coord)``
Checks if the tile is in burrow.
diff --git a/Lua API.html b/Lua API.html
index 7c3eeddb9..66385840b 100644
--- a/Lua API.html
+++ b/Lua API.html
@@ -900,6 +900,12 @@ a lua list containing them.
+dfhack.units.getPosition(unit)
+Returns true x,y,z of the unit; may be not equal to unit.pos if caged.
+
+dfhack.units.getContainer(unit)
+Returns the container (cage) item or nil.
+
dfhack.units.setNickname(unit,nick)
Sets the unit's nickname properly.
@@ -918,6 +924,9 @@ a lua list containing them.
dfhack.units.isSane(unit)
The unit is capable of rational action, i.e. not dead, insane or zombie.
+dfhack.units.clearBurrowMembers(burrow)
+Removes all units from the burrow.
+
dfhack.units.isInBurrow(unit,burrow)
Checks if the unit is in the burrow.
@@ -929,6 +938,9 @@ a lua list containing them.
+dfhack.items.getPosition(item)
+Returns true x,y,z of the item; may be not equal to item.pos if in inventory.
+
dfhack.items.getOwner(item)
Returns the owner unit or nil.
@@ -936,6 +948,18 @@ a lua list containing them.
Replaces the owner of the item. If unit is nil, removes ownership.
Returns false in case of error.
+dfhack.items.getContainer(item)
+Returns the container item or nil.
+
+dfhack.items.getContainedItems(item)
+Returns a list of items contained in this one.
+
+dfhack.items.moveToGround(item,pos)
+Move the item to the ground at position. Returns false if impossible.
+
+dfhack.items.moveToContainer(item,container)
+Move the item to the container. Returns false if impossible.
+
@@ -968,6 +992,9 @@ Returns
false in case of error.
dfhack.maps.listBurrowBlocks(burrow)
Returns a table of map block pointers.
+
dfhack.maps.clearBurrowTiles(burrow)
+Removes all tiles from the burrow.
+
dfhack.maps.isBurrowTile(burrow,tile_coord)
Checks if the tile is in burrow.
diff --git a/build/generate-MSVC-all-breakfast.bat b/build/generate-MSVC-all-breakfast.bat
new file mode 100644
index 000000000..08c5b03ff
--- /dev/null
+++ b/build/generate-MSVC-all-breakfast.bat
@@ -0,0 +1,8 @@
+@echo off
+IF EXIST DF_PATH.txt SET /P _DF_PATH=
lock(d->AccessMutex);
@@ -877,6 +873,22 @@ int Core::Update()
d->df_suspend_depth = 1000;
}
+ // Initialize the core
+ bool first_update = false;
+
+ if(!started)
+ {
+ first_update = true;
+ Init();
+ if(errorstate)
+ return -1;
+ }
+
+ color_ostream_proxy out(con);
+
+ if (first_update)
+ plug_mgr->OnStateChange(out, SC_CORE_INITIALIZED);
+
// detect if the game was loaded or unloaded in the meantime
void *new_wdata = NULL;
void *new_mapdata = NULL;
diff --git a/library/DataDefs.cpp b/library/DataDefs.cpp
deleted file mode 100644
index cf8a32fcc..000000000
--- a/library/DataDefs.cpp
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
-https://github.com/peterix/dfhack
-Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
-
-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