Position writing

develop
Simon Jackson 2010-06-22 18:27:27 +01:00
parent 3f0ab50b5d
commit e1e1850d8e
2 changed files with 14 additions and 0 deletions

@ -389,6 +389,7 @@ namespace DFHack
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);
bool WritePos(const uint32_t index, const t_creature &creature);
private:
struct Private;

@ -519,6 +519,19 @@ bool Creatures::WriteMoodSkill(const uint32_t index, const uint16_t moodSkill)
return true;
}
bool Creatures::WritePos(const uint32_t index, const t_creature &creature)
{
if(!d->Started)
{
return false;
}
uint32_t temp = d->p_cre->at (index);
Process * p = d->owner;
p->write (temp + d->creatures.pos_offset, 3 * sizeof (uint16_t), (uint8_t *) & (creature.x));
return true;
}
uint32_t Creatures::GetDwarfRaceIndex()
{
if(!d->Inited) return 0;