Added mood writing. Mood only, not skill or anything. Seems to work ok

develop
Simon Jackson 2010-06-17 23:18:01 +01:00
parent 061108c685
commit 96c774629a
2 changed files with 12 additions and 0 deletions

@ -387,6 +387,7 @@ namespace DFHack
bool WriteAttributes(const uint32_t index, const t_creature &creature);
bool WriteSex(const uint32_t index, const uint8_t sex);
bool WriteTraits(const uint32_t index, const t_soul &soul);
bool WriteMood(const uint32_t index, const uint16_t mood);
private:
struct Private;

@ -474,6 +474,17 @@ bool Creatures::WriteTraits(const uint32_t index, const t_soul &soul)
return true;
}
bool Creatures::WriteMood(const uint32_t index, const uint16_t mood)
{
if(!d->Started)
return false;
uint32_t temp = d->p_cre->at (index);
Process * p = d->owner;
p->writeWord(temp + d->creatures.mood_offset, mood);
return true;
}
uint32_t Creatures::GetDwarfRaceIndex()
{
if(!d->Inited) return 0;