diff --git a/library/include/modules/Constructions.h b/library/include/modules/Constructions.h index 2a7e03202..2e771b301 100644 --- a/library/include/modules/Constructions.h +++ b/library/include/modules/Constructions.h @@ -58,6 +58,7 @@ struct t_construction { DFHACK_EXPORT bool isValid(); DFHACK_EXPORT uint32_t getCount(); DFHACK_EXPORT bool copyConstruction (const int32_t index, t_construction &out); +DFHACK_EXPORT df::construction * getConstruction (const int32_t index); } } } diff --git a/library/include/modules/Engravings.h b/library/include/modules/Engravings.h index d4cbe5adb..6c80eac7b 100644 --- a/library/include/modules/Engravings.h +++ b/library/include/modules/Engravings.h @@ -59,6 +59,7 @@ struct t_engraving { DFHACK_EXPORT bool isValid(); DFHACK_EXPORT uint32_t getCount(); DFHACK_EXPORT bool copyEngraving (const int32_t index, t_engraving &out); +DFHACK_EXPORT df::engraving * getEngraving (const int32_t index); } } } diff --git a/library/include/modules/Vegetation.h b/library/include/modules/Vegetation.h index 88f24eb6b..492c19782 100644 --- a/library/include/modules/Vegetation.h +++ b/library/include/modules/Vegetation.h @@ -65,6 +65,7 @@ struct t_plant { DFHACK_EXPORT bool isValid(); DFHACK_EXPORT uint32_t getCount(); +DFHACK_EXPORT df::plant * getPlant(const int32_t index); DFHACK_EXPORT bool copyPlant (const int32_t index, t_plant &out); } } diff --git a/library/modules/Constructions.cpp b/library/modules/Constructions.cpp index 3ece46835..12658bb12 100644 --- a/library/modules/Constructions.cpp +++ b/library/modules/Constructions.cpp @@ -51,6 +51,13 @@ uint32_t Constructions::getCount() return world->constructions.size(); } +df::construction * Constructions::getConstruction(const int32_t index) +{ + if (index < 0 || index >= getCount()) + return NULL; + return world->constructions[index]; +} + bool Constructions::copyConstruction(const int32_t index, t_construction &out) { if (index < 0 || index >= getCount()) diff --git a/library/modules/Engravings.cpp b/library/modules/Engravings.cpp index b4faba8f7..c7cbd9452 100644 --- a/library/modules/Engravings.cpp +++ b/library/modules/Engravings.cpp @@ -52,6 +52,13 @@ uint32_t Engravings::getCount() return world->engravings.size(); } +df::engraving * Engravings::getEngraving(int index) +{ + if (index < 0 || index >= getCount()) + return NULL; + return world->engravings[index]; +} + bool Engravings::copyEngraving(const int32_t index, t_engraving &out) { if (index < 0 || index >= getCount()) diff --git a/library/modules/Vegetation.cpp b/library/modules/Vegetation.cpp index da69ef589..2b403448b 100644 --- a/library/modules/Vegetation.cpp +++ b/library/modules/Vegetation.cpp @@ -53,6 +53,13 @@ uint32_t Vegetation::getCount() return world->plants.all.size(); } +df::plant * Vegetation::getPlant(const int32_t index) +{ + if (index < 0 || index >= getCount()) + return NULL; + return world->plants.all[index]; +} + bool Vegetation::copyPlant(const int32_t index, t_plant &out) { if (index < 0 || index >= getCount()) diff --git a/plugins/mapexport/mapexport.cpp b/plugins/mapexport/mapexport.cpp index 2cca26b35..3b9004d52 100644 --- a/plugins/mapexport/mapexport.cpp +++ b/plugins/mapexport/mapexport.cpp @@ -43,7 +43,7 @@ DFhackCExport command_result mapexport (Core * c, std::vector & pa { c->con.print("Exports the currently visible map to a file.\n" "Usage: mapexport \n" - ); + ); return CR_OK; } }