diff --git a/library/DFTypes_C.cpp b/library/DFTypes_C.cpp index b8f0a6a9b..cef3190bd 100644 --- a/library/DFTypes_C.cpp +++ b/library/DFTypes_C.cpp @@ -32,6 +32,7 @@ using namespace std; #include "Internal.h" #include "dfhack/DFTypes.h" +#include "dfhack/DFTileTypes.h" #include "dfhack-c/DFTypes_C.h" #include "dfhack/modules/Materials.h" @@ -101,6 +102,16 @@ int DFHack_getVegetationType(int in) return DFHack::getVegetationType(in); } +int DFHack_getTileType(int index, TileRow* tPtr) +{ + if(index >= TILE_TYPE_ARRAY_LENGTH) + return 0; + + *tPtr = tileTypeTable[index]; + + return 1; +} + #ifdef __cplusplus } #endif diff --git a/library/include/dfhack-c/DFTypes_C.h b/library/include/dfhack-c/DFTypes_C.h index fbd883ead..a38f9071e 100644 --- a/library/include/dfhack-c/DFTypes_C.h +++ b/library/include/dfhack-c/DFTypes_C.h @@ -112,6 +112,8 @@ DFHACK_EXPORT extern int DFHack_isStairTerrain(int in); DFHACK_EXPORT extern int DFHack_isOpenTerrain(int in); DFHACK_EXPORT extern int DFHack_getVegetationType(int in); +DFHACK_EXPORT extern int DFHack_getTileType(int index, TileRow* tPtr); + #ifdef __cplusplus } #endif