[wpdev-commits] wolfpack/python item.cpp,1.70,1.71 multi.cpp,1.16,1.17
Brought to you by:
rip,
thiagocorrea
|
From: <dar...@us...> - 2003-08-23 16:29:19
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv4263/src/python
Modified Files:
item.cpp multi.cpp
Log Message:
Removed door code from the core.
Index: item.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** item.cpp 20 Aug 2003 17:10:49 -0000 1.70
--- item.cpp 23 Aug 2003 15:20:29 -0000 1.71
***************
*** 37,40 ****
--- 37,41 ----
#include "../scriptmanager.h"
#include "../itemid.h"
+ #include "../multis.h"
#include "../books.h"
#include "../basechar.h"
***************
*** 701,704 ****
--- 702,718 ----
}
+ // If we are in a multi, return the multi object for it
+ // otherwise pynone
+ static PyObject* wpItem_multi( wpItem* self, PyObject* args )
+ {
+ if( self->pItem->free )
+ {
+ Py_INCREF( Py_None );
+ return Py_None;
+ }
+
+ return PyGetMultiObject( dynamic_cast< cMulti* >( FindItemBySerial( self->pItem->multis() ) ) );
+ }
+
static PyMethodDef wpItemMethods[] =
{
***************
*** 719,722 ****
--- 733,737 ----
{ "getadv", (getattrofunc)wpItem_getadv, METH_VARARGS,"Get advanced modifiers." },
{ "setadv", (getattrofunc)wpItem_setadv, METH_VARARGS,"Set advanced modifiers." },
+ { "multi", (getattrofunc)wpItem_multi, METH_VARARGS, NULL },
// Effects
Index: multi.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/multi.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** multi.cpp 20 Aug 2003 17:10:49 -0000 1.16
--- multi.cpp 23 Aug 2003 15:20:29 -0000 1.17
***************
*** 515,518 ****
--- 515,541 ----
}
+ /*
+ * Is the player authorized?
+ */
+ static PyObject* wpMulti_authorized( wpMulti* self, PyObject* args )
+ {
+ if( self->pMulti->free )
+ return PyFalse;
+
+ if( !checkArgChar( 0 ) )
+ return PyFalse;
+
+ P_PLAYER pChar = dynamic_cast< P_PLAYER >( getArgChar( 0 ) );
+
+ if( pChar )
+ {
+ return self->pMulti->authorized( pChar ) ? PyTrue : PyFalse;
+ }
+ else
+ {
+ return PyFalse;
+ }
+ }
+
static PyMethodDef wpMultiMethods[] =
{
***************
*** 527,533 ****
{ "items", (getattrofunc)wpMulti_items, METH_VARARGS, "Returns the list of the items in this multi." },
{ "friends", (getattrofunc)wpMulti_friends, METH_VARARGS, "Returns the friends list of this multi." },
! { "bans", (getattrofunc)wpMulti_friends, METH_VARARGS, "Returns the ban list of this multi." },
{ "addchtile", (getattrofunc)wpMulti_addchtile, METH_VARARGS, "Adds a tile to the custom house." },
{ "sendcustomhouse", (getattrofunc)wpMulti_sendcustomhouse, METH_VARARGS, "Sends custom house." },
// Tag System
--- 550,557 ----
{ "items", (getattrofunc)wpMulti_items, METH_VARARGS, "Returns the list of the items in this multi." },
{ "friends", (getattrofunc)wpMulti_friends, METH_VARARGS, "Returns the friends list of this multi." },
! { "bans", (getattrofunc)wpMulti_bans, METH_VARARGS, "Returns the ban list of this multi." },
{ "addchtile", (getattrofunc)wpMulti_addchtile, METH_VARARGS, "Adds a tile to the custom house." },
{ "sendcustomhouse", (getattrofunc)wpMulti_sendcustomhouse, METH_VARARGS, "Sends custom house." },
+ { "authorized", (getattrofunc)wpMulti_authorized, METH_VARARGS, NULL },
// Tag System
|