… | |
… | |
1418 | return NULL; |
1418 | return NULL; |
1419 | if ( ( resist < 0 ) || ( resist >= NROFATTACKS ) ) |
1419 | if ( ( resist < 0 ) || ( resist >= NROFATTACKS ) ) |
1420 | { |
1420 | { |
1421 | return Py_BuildValue("l",0); |
1421 | return Py_BuildValue("l",0); |
1422 | } |
1422 | } |
1423 | return Py_BuildValue("i",*( sint16* )cf_object_get_resistance( who->obj, resist)); |
1423 | return Py_BuildValue("i",cf_object_get_resistance( who->obj, resist)); |
1424 | } |
1424 | } |
1425 | static PyObject* Crossfire_Object_QueryCost( Crossfire_Object* who, PyObject* args ) |
1425 | static PyObject* Crossfire_Object_QueryCost( Crossfire_Object* who, PyObject* args ) |
1426 | { |
1426 | { |
1427 | int flags; |
1427 | int flags; |
1428 | Crossfire_Object* pcause; |
1428 | Crossfire_Object* pcause; |
… | |
… | |
1635 | return Crossfire_Object_wrap(myob); |
1635 | return Crossfire_Object_wrap(myob); |
1636 | } |
1636 | } |
1637 | |
1637 | |
1638 | static int Crossfire_Object_InternalCompare(Crossfire_Object* left, Crossfire_Object* right) |
1638 | static int Crossfire_Object_InternalCompare(Crossfire_Object* left, Crossfire_Object* right) |
1639 | { |
1639 | { |
1640 | return ((int)left->obj - (int)right->obj); |
1640 | return (left->obj < right->obj ? -1 : ( left->obj == right->obj ? 0 : 1 ) ); |
1641 | } |
1641 | } |
1642 | |
1642 | |
1643 | /* Legacy code: convert to long so that non-object functions work correctly */ |
1643 | /* Legacy code: convert to long so that non-object functions work correctly */ |
1644 | static PyObject* Crossfire_Object_Long( PyObject* obj ) |
1644 | static PyObject* Crossfire_Object_Long( PyObject* obj ) |
1645 | { |
1645 | { |