[wpdev-commits] wolfpack/python char.cpp,1.184,1.185 item.cpp,1.125,1.126
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-08-27 14:41:29
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23599/python Modified Files: char.cpp item.cpp Log Message: basescripts property Index: item.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** item.cpp 25 Aug 2004 17:01:33 -0000 1.125 --- item.cpp 27 Aug 2004 14:41:18 -0000 1.126 *************** *** 1039,1055 **** } ! if ( cPythonScript::canChainHandleEvent( ( ePythonEvent ) event, self->pItem->getScripts() ) ) ! { ! bool result = cPythonScript::callChainedEventHandler( ( ePythonEvent ) event, self->pItem->getScripts(), eventargs ); ! if ( result ) ! { ! Py_INCREF( Py_True ); ! return Py_True; ! } } ! Py_INCREF( Py_False ); ! return Py_False; } --- 1039,1050 ---- } ! PyObject *result = self->pItem->callEvent((ePythonEvent)event, eventargs); ! if (!result) { ! result = Py_None; ! Py_INCREF(result); } ! return result; } *************** *** 1199,1203 **** else if ( !strcmp( "scripts", name ) ) { ! QStringList events = QStringList::split( ",", self->pItem->scriptList() ); PyObject* list = PyList_New( events.count() ); for ( uint i = 0; i < events.count(); ++i ) --- 1194,1207 ---- else if ( !strcmp( "scripts", name ) ) { ! QStringList events = QStringList::split(",", self->pItem->scriptList()); ! if (self->pItem->basedef()) { ! const QPtrList<cPythonScript> &list = self->pItem->basedef()->baseScripts(); ! QPtrList<cPythonScript>::const_iterator it(list.begin()); ! while (it != list.end()) { ! events.append( (*it)->name() ); ! ++it; ! } ! } ! PyObject* list = PyList_New( events.count() ); for ( uint i = 0; i < events.count(); ++i ) Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.184 retrieving revision 1.185 diff -C2 -d -r1.184 -r1.185 *** char.cpp 26 Aug 2004 00:51:11 -0000 1.184 --- char.cpp 27 Aug 2004 14:41:17 -0000 1.185 *************** *** 2298,2314 **** } ! if ( cPythonScript::canChainHandleEvent( ( ePythonEvent ) event, self->pChar->getScripts() ) ) ! { ! bool result = cPythonScript::callChainedEventHandler( ( ePythonEvent ) event, self->pChar->getScripts(), eventargs ); ! if ( result ) ! { ! Py_INCREF( Py_True ); ! return Py_True; ! } } ! Py_INCREF( Py_False ); ! return Py_False; } --- 2298,2309 ---- } ! PyObject *result = self->pChar->callEvent((ePythonEvent)event, eventargs); ! if (!result) { ! result = Py_None; ! Py_INCREF(result); } ! return result; } *************** *** 2647,2650 **** --- 2642,2653 ---- { QStringList scripts = QStringList::split( ",", self->pChar->scriptList() ); + if (self->pChar->basedef()) { + const QPtrList<cPythonScript> &list = self->pChar->basedef()->baseScripts(); + QPtrList<cPythonScript>::const_iterator it(list.begin()); + while (it != list.end()) { + scripts.append( (*it)->name() ); + ++it; + } + } PyObject* list = PyList_New( scripts.count() ); for ( uint i = 0; i < scripts.count(); ++i ) |