From 244a3c1333d62fe0b50cd9ad8a75d8c71c87fa51 Mon Sep 17 00:00:00 2001 From: doomchild Date: Tue, 13 Apr 2010 08:55:39 -0500 Subject: [PATCH] fixed a couple of attribute accesses --- dfhack/python/DF_CreatureType.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dfhack/python/DF_CreatureType.cpp b/dfhack/python/DF_CreatureType.cpp index a2e481338..99a4e081a 100644 --- a/dfhack/python/DF_CreatureType.cpp +++ b/dfhack/python/DF_CreatureType.cpp @@ -87,6 +87,8 @@ static PyObject* DF_Creature_Base_new(PyTypeObject* type, PyObject* args, PyObje self->name = PyString_FromString(""); self->artifact_name = PyString_FromString(""); + self->position = NULL; + self->strength = NULL; self->agility = NULL; self->toughness = NULL; @@ -136,8 +138,10 @@ static void DF_Creature_Base_dealloc(DF_Creature_Base* self) static PyMemberDef DF_Creature_Base_members[] = { {"origin", T_UINT, offsetof(DF_Creature_Base, origin), 0, ""}, + {"position", T_OBJECT_EX, offsetof(DF_Creature_Base, position), 0, ""}, {"_flags1", T_UINT, offsetof(DF_Creature_Base, flags1), 0, ""}, {"_flags2", T_UINT, offsetof(DF_Creature_Base, flags2), 0, ""}, + {"race", T_UINT, offsetof(DF_Creature_Base, race), 0, ""}, {"name", T_OBJECT_EX, offsetof(DF_Creature_Base, name), 0, ""}, {"artifact_name", T_OBJECT_EX, offsetof(DF_Creature_Base, artifact_name), 0, ""}, {"profession", T_INT, offsetof(DF_Creature_Base, profession), 0, ""}, @@ -211,11 +215,13 @@ static PyObject* BuildCreature(DFHack::t_creature& creature) if(obj != NULL) { + obj->origin = creature.origin; obj->position = Py_BuildValue("III", creature.x, creature.y, creature.z); obj->profession = creature.profession; obj->mood = creature.mood; obj->happiness = creature.happiness; obj->c_id = creature.id; + obj->race = creature.race; obj->agility = BuildAttribute(creature.agility); obj->strength = BuildAttribute(creature.strength); obj->toughness = BuildAttribute(creature.toughness);