Civilisation writing

develop
Simon Jackson 2010-06-23 03:32:33 +01:00
parent e1e1850d8e
commit 4f009a5c5c
3 changed files with 15 additions and 0 deletions

@ -646,6 +646,7 @@ string memory_info::getProfession (const uint32_t key) const
string memory_info::getJob (const uint32_t key) const string memory_info::getJob (const uint32_t key) const
{ {
if(d->jobs.size() > key) if(d->jobs.size() > key)
{ {
return d->jobs[key]; return d->jobs[key];
} }

@ -390,6 +390,7 @@ namespace DFHack
bool WriteMood(const uint32_t index, const uint16_t mood); bool WriteMood(const uint32_t index, const uint16_t mood);
bool WriteMoodSkill(const uint32_t index, const uint16_t moodSkill); bool WriteMoodSkill(const uint32_t index, const uint16_t moodSkill);
bool WritePos(const uint32_t index, const t_creature &creature); bool WritePos(const uint32_t index, const t_creature &creature);
bool WriteCiv(const uint32_t index, const int32_t civ);
private: private:
struct Private; struct Private;

@ -532,6 +532,19 @@ bool Creatures::WritePos(const uint32_t index, const t_creature &creature)
return true; return true;
} }
bool Creatures::WriteCiv(const uint32_t index, const int32_t civ)
{
if(!d->Started)
{
return false;
}
uint32_t temp = d->p_cre->at (index);
Process * p = d->owner;
p->writeDWord(temp + d->creatures.civ_offset, civ);
return true;
}
uint32_t Creatures::GetDwarfRaceIndex() uint32_t Creatures::GetDwarfRaceIndex()
{ {
if(!d->Inited) return 0; if(!d->Inited) return 0;