Flag writing function added

develop
Simon Jackson 2010-06-15 17:28:05 +01:00
parent 1b63a4e64d
commit 2ad6bcb9cc
2 changed files with 16 additions and 1 deletions

@ -380,6 +380,7 @@ namespace DFHack
// write labors of a creature (for Dwarf Therapist)
bool WriteLabors(const uint32_t index, uint8_t labors[NUM_CREATURE_LABORS]);
bool WriteHappiness(const uint32_t index, const uint32_t happinessValue);
bool WriteFlags(const uint32_t index, const uint32_t flags1, const uint32_t flags2);
private:
struct Private;

@ -371,6 +371,20 @@ bool Creatures::WriteHappiness(const uint32_t index, const uint32_t happinessVal
return true;
}
bool Creatures::WriteFlags(const uint32_t index,
const uint32_t flags1,
const uint32_t flags2)
{
if(!d->Started)
return false;
uint32_t temp = d->p_cre->at (index);
Process * p = d->owner;
p->writeDWord (temp + d->creatures.flags1_offset, flags1);
p->writeDWord (temp + d->creatures.flags2_offset, flags1);
return true;
}
uint32_t Creatures::GetDwarfRaceIndex()
{
if(!d->Inited) return 0;