|
|
|
@ -104,6 +104,64 @@ t_material* Creatures_ReadJob(DFHackObject* cPtr, const t_creature* furball)
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t* Creatures_ReadInventoryIdx(DFHackObject* cPtr, const uint32_t index)
|
|
|
|
|
{
|
|
|
|
|
if(cPtr != NULL)
|
|
|
|
|
{
|
|
|
|
|
std::vector<uint32_t> item;
|
|
|
|
|
|
|
|
|
|
if(((DFHack::Creatures*)cPtr)->ReadInventoryIdx(index, item))
|
|
|
|
|
{
|
|
|
|
|
if(item.size() <= 0)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
uint32_t* buf;
|
|
|
|
|
|
|
|
|
|
(*alloc_uint_buffer_callback)(buf, item.size());
|
|
|
|
|
|
|
|
|
|
if(buf != NULL)
|
|
|
|
|
{
|
|
|
|
|
copy(item.begin(), item.end(), buf);
|
|
|
|
|
|
|
|
|
|
return buf;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t* Creatures_ReadInventoryPtr(DFHackObject* cPtr, const uint32_t index)
|
|
|
|
|
{
|
|
|
|
|
if(cPtr != NULL)
|
|
|
|
|
{
|
|
|
|
|
std::vector<uint32_t> item;
|
|
|
|
|
|
|
|
|
|
if(((DFHack::Creatures*)cPtr)->ReadInventoryPtr(index, item))
|
|
|
|
|
{
|
|
|
|
|
if(item.size() <= 0)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
uint32_t* buf;
|
|
|
|
|
|
|
|
|
|
(*alloc_uint_buffer_callback)(buf, item.size());
|
|
|
|
|
|
|
|
|
|
if(buf != NULL)
|
|
|
|
|
{
|
|
|
|
|
copy(item.begin(), item.end(), buf);
|
|
|
|
|
|
|
|
|
|
return buf;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t Creatures_GetDwarfRaceIndex(DFHackObject* cPtr)
|
|
|
|
|
{
|
|
|
|
|
if(cPtr != NULL)
|
|
|
|
|