From 3f0ab50b5d913ed5062452ebfb902aa9ac86046b Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Tue, 22 Jun 2010 17:21:09 +0100 Subject: [PATCH] mood skill writing --- library/include/dfhack/modules/Creatures.h | 1 + library/modules/Creatures.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/library/include/dfhack/modules/Creatures.h b/library/include/dfhack/modules/Creatures.h index 062319f9f..2ac55ac0c 100644 --- a/library/include/dfhack/modules/Creatures.h +++ b/library/include/dfhack/modules/Creatures.h @@ -388,6 +388,7 @@ namespace DFHack 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); + bool WriteMoodSkill(const uint32_t index, const uint16_t moodSkill); private: struct Private; diff --git a/library/modules/Creatures.cpp b/library/modules/Creatures.cpp index 6d2466e63..de307e91c 100644 --- a/library/modules/Creatures.cpp +++ b/library/modules/Creatures.cpp @@ -506,6 +506,19 @@ bool Creatures::WriteMood(const uint32_t index, const uint16_t mood) return true; } +bool Creatures::WriteMoodSkill(const uint32_t index, const uint16_t moodSkill) +{ + if(!d->Started) + { + return false; + } + + uint32_t temp = d->p_cre->at (index); + Process * p = d->owner; + p->writeWord(temp + d->creatures.mood_skill_offset, moodSkill); + return true; +} + uint32_t Creatures::GetDwarfRaceIndex() { if(!d->Inited) return 0;