diff options
| author | Petr Mrázek | 2012-03-26 16:16:12 +0200 |
|---|---|---|
| committer | Petr Mrázek | 2012-03-26 16:16:12 +0200 |
| commit | f854810fb76a6c83a9ccd3a50f526963b5c85b90 (patch) | |
| tree | 53d4dc9001d65434a0de2f8a4b649772f9c3b63c /MapLoading.cpp | |
| parent | a0f6808254168063449b4f7e93afbd879bd1fafd (diff) | |
| parent | df37cc7e59b3cf5fadfa680a68793b91810a30ff (diff) | |
| download | stonesense-f854810fb76a6c83a9ccd3a50f526963b5c85b90.tar.gz stonesense-f854810fb76a6c83a9ccd3a50f526963b5c85b90.tar.bz2 stonesense-f854810fb76a6c83a9ccd3a50f526963b5c85b90.tar.xz | |
Merge https://github.com/JapaMala/stonesense
Diffstat (limited to 'MapLoading.cpp')
| -rw-r--r-- | MapLoading.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/MapLoading.cpp b/MapLoading.cpp index 751d016..19ab329 100644 --- a/MapLoading.cpp +++ b/MapLoading.cpp @@ -13,6 +13,7 @@ #include "df/item_constructed.h"
#include "df/itemimprovement.h"
#include "df/itemimprovement_threadst.h"
+#include "df/item_threadst.h"
/*
static DFHack::Core* pDFApiHandle = 0;
static DFHack::Process * DFProc = 0;
@@ -506,7 +507,7 @@ void ReadCellToSegment(DFHack::Core& DF, WorldSegment& segment, int CellX, int C b->Item.matt.type = found_item->getActualMaterial();
b->Item.matt.index = found_item->getActualMaterialIndex();
- if(found_item->isDyed())
+ if(1)//found_item->isDyed())
{
auto Constructed_Item = virtual_cast<df::item_constructed>(found_item);
if(Constructed_Item)
@@ -520,10 +521,21 @@ void ReadCellToSegment(DFHack::Core& DF, WorldSegment& segment, int CellX, int C auto Improvement_Thread = virtual_cast<df::itemimprovement_threadst>(Constructed_Item->improvements[idex]);
if(!Improvement_Thread)
continue;
+ if (Improvement_Thread->dye.mat_type < 0) break;
b->Item.matt.type = Improvement_Thread->dye.mat_type;
b->Item.matt.index = Improvement_Thread->dye.mat_index;
+ b->Item.dyed = 1;
}
}
+ else if (found_item->getType() == item_type::THREAD)
+ {
+ auto Thread_Item = virtual_cast<df::item_threadst>(found_item);
+ if(!Thread_Item) break;
+ if (Thread_Item->dye_mat_type < 0) break;
+ b->Item.matt.type = Thread_Item->dye_mat_type;
+ b->Item.matt.index = Thread_Item->dye_mat_index;
+ b->Item.dyed = 1;
+ }
}
}
|
