From afc051d03214714a3adea4e8ef028abda7bba0d8 Mon Sep 17 00:00:00 2001 From: doomchild Date: Sat, 3 Apr 2010 20:58:06 -0500 Subject: [PATCH] added getter for window size added ReadHotkeys --- library/pydfhack/DF_API.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/pydfhack/DF_API.cpp b/library/pydfhack/DF_API.cpp index 708e99314..d70b969a5 100644 --- a/library/pydfhack/DF_API.cpp +++ b/library/pydfhack/DF_API.cpp @@ -905,9 +905,9 @@ static PyObject* DF_API_WriteDesignations(DF_API* self, PyObject* args) for(int j = 0; j < 16; j++) { - UnionBase* obj = (UnionBase*)PyList_GetItem(innerList, j); + unsigned int obj = (unsigned int)PyInt_AsUnsignedLongMask(PyList_GetItem(innerList, j)); - designations[i][j].whole = obj->whole; + designations[i][j].whole = obj; } } @@ -967,9 +967,9 @@ static PyObject* DF_API_WriteOccupancy(DF_API* self, PyObject* args) for(int j = 0; j < 16; j++) { - UnionBase* obj = (UnionBase*)PyList_GetItem(innerList, j); + unsigned int obj = PyInt_AsLong(PyList_GetItem(innerList, j)); - occupancies[i][j].whole = obj->whole; + occupancies[i][j].whole = obj; } }