diff --git a/library/include/dfhack/modules/Materials.h b/library/include/dfhack/modules/Materials.h
index aac990751..f3ac6425c 100644
--- a/library/include/dfhack/modules/Materials.h
+++ b/library/include/dfhack/modules/Materials.h
@@ -145,6 +145,7 @@ namespace DFHack
void ReadAllMaterials(void);
+ std::string getType(t_material & mat);
std::string getDescription(t_material & mat);
private:
class Private;
diff --git a/library/modules/Creatures.cpp b/library/modules/Creatures.cpp
index a467a9e6b..0edb713f3 100644
--- a/library/modules/Creatures.cpp
+++ b/library/modules/Creatures.cpp
@@ -202,7 +202,7 @@ bool Creatures::ReadCreature (const int32_t index, t_creature & furball)
// mood stuff
furball.mood = (int16_t) p->readWord (temp + offs.mood_offset);
furball.mood_skill = p->readWord (temp + offs.mood_skill_offset);
- d->d->readName(furball.artifact_name, temp + offs.artifact_name_offset);
+ d->d->readName(furball.artifact_name, temp + offs.artifact_name_offset);
// custom profession
p->readSTLString(temp + offs.custom_profession_offset, furball.custom_profession, sizeof(furball.custom_profession));
diff --git a/library/modules/Materials.cpp b/library/modules/Materials.cpp
index 481d23568..58f98c54c 100644
--- a/library/modules/Materials.cpp
+++ b/library/modules/Materials.cpp
@@ -470,3 +470,53 @@ std::string Materials::getDescription(t_material & mat)
return out;
}
+//type of material only so we know which vector to retrieve
+std::string Materials::getType(t_material & mat)
+{
+ if((mat.subIndex<419) || (mat.subIndex>618))
+ {
+ if((mat.subIndex<19) || (mat.subIndex>218))
+ {
+ if(mat.subIndex)
+ {
+ if(mat.subIndex>0x292)
+ {
+ return "unknown";
+ }
+ else
+ {
+ if(mat.subIndex>=this->other.size())
+ {
+ if(mat.subIndex<0)
+ return "any";
+
+ if(mat.subIndex>=this->raceEx.size())
+ return "unknown";
+
+ return "racex";
+ }
+ else
+ {
+ if (mat.index==-1)
+ return "other";
+ else
+ return "other derivate";
+ }
+ }
+ }
+ else
+ return "inorganic";
+ }
+ else
+ {
+ if (mat.index>=this->raceEx.size())
+ return "unknown";
+
+ return "racex extract";
+ }
+ }
+ else
+ {
+ return "organic";
+ }
+}
\ No newline at end of file
diff --git a/output/Memory.xml b/output/Memory.xml
index d9537981c..a936fc4a3 100755
--- a/output/Memory.xml
+++ b/output/Memory.xml
@@ -1685,7 +1685,23 @@ map_data_1b60_offset 0x1B9c