Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11978
Modified Files:
items.cpp speech.cpp territories.cpp timers.cpp trade.cpp
uobject.cpp uobject.h walking.cpp wolfpack.vcproj
Log Message:
Changed all references to "events" to "scripts"
Index: trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** trade.cpp 19 Aug 2004 01:55:56 -0000 1.10
--- trade.cpp 25 Aug 2004 17:01:23 -0000 1.11
***************
*** 317,321 ****
if ( ( *it )->id() == pItem->id() && ( *it )->color() == pItem->color() &&
// (*it)->amount() >= pItem->amount() &&
! ( *it )->eventList() == pItem->eventList() )
{
found = true;
--- 317,321 ----
if ( ( *it )->id() == pItem->id() && ( *it )->color() == pItem->color() &&
// (*it)->amount() >= pItem->amount() &&
! ( *it )->scriptList() == pItem->scriptList() )
{
found = true;
Index: territories.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** territories.cpp 10 Aug 2004 03:15:57 -0000 1.52
--- territories.cpp 25 Aug 2004 17:01:23 -0000 1.53
***************
*** 389,393 ****
PyObject* args = Py_BuildValue( "(NNN)", PyGetCharObject( pc ), PyGetRegionObject( lastRegion ), PyGetRegionObject( currRegion ) );
! if ( !cPythonScript::callChainedEventHandler( EVENT_CHANGEREGION, pc->getEvents(), args ) && socket )
{
if ( lastRegion && !lastRegion->name().isEmpty() && !lastRegion->isNoEnterMessage() )
--- 389,393 ----
PyObject* args = Py_BuildValue( "(NNN)", PyGetCharObject( pc ), PyGetRegionObject( lastRegion ), PyGetRegionObject( currRegion ) );
! if ( !cPythonScript::callChainedEventHandler( EVENT_CHANGEREGION, pc->getScripts(), args ) && socket )
{
if ( lastRegion && !lastRegion->name().isEmpty() && !lastRegion->isNoEnterMessage() )
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.180
retrieving revision 1.181
diff -C2 -d -r1.180 -r1.181
*** uobject.cpp 25 Aug 2004 00:41:25 -0000 1.180
--- uobject.cpp 25 Aug 2004 17:01:23 -0000 1.181
***************
*** 157,165 ****
pos_.z = atoi( result[offset++] );
pos_.map = atoi( result[offset++] );
! QString eventList = ( result[offset] == 0 ) ? QString::null : QString( result[offset] );
offset++;
bool havetags_ = atoi( result[offset++] );
! setEventList( eventList );
if ( havetags_ )
--- 157,165 ----
pos_.z = atoi( result[offset++] );
pos_.map = atoi( result[offset++] );
! QString scriptList = ( result[offset] == 0 ) ? QString::null : QString( result[offset] );
offset++;
bool havetags_ = atoi( result[offset++] );
! setScriptList( scriptList );
if ( havetags_ )
***************
*** 203,208 ****
addField( "pos_z", pos_.z );
addField( "pos_map", pos_.map );
! QString eventList = this->eventList();
! addStrField( "events", eventList == QString::null ? QString( "" ) : eventList );
addCondition( "serial", serial_ );
addField( "havetags", havetags_ );
--- 203,208 ----
addField( "pos_z", pos_.z );
addField( "pos_map", pos_.map );
! QString scriptList = this->scriptList();
! addStrField( "events", scriptList == QString::null ? QString( "" ) : scriptList );
addCondition( "serial", serial_ );
addField( "havetags", havetags_ );
***************
*** 227,231 ****
writer.writeByte( pos_.z );
writer.writeByte( pos_.map );
! writer.writeUtf8( eventList() );
}
--- 227,231 ----
writer.writeByte( pos_.z );
writer.writeByte( pos_.map );
! writer.writeUtf8( scriptList() );
}
***************
*** 239,243 ****
pos_.z = reader.readByte();
pos_.map = reader.readByte();
! setEventList( reader.readUtf8() );
}
--- 239,243 ----
pos_.z = reader.readByte();
pos_.map = reader.readByte();
! setScriptList( reader.readUtf8() );
}
***************
*** 277,281 ****
Clears the script-chain
*/
! void cUObject::clearEvents()
{
if ( scriptChain )
--- 277,281 ----
Clears the script-chain
*/
! void cUObject::clearScripts()
{
if ( scriptChain )
***************
*** 312,316 ****
\sa addEvent
*/
! bool cUObject::hasEvent( const QString& name ) const
{
if ( scriptChain )
--- 312,316 ----
\sa addEvent
*/
! bool cUObject::hasScript( const QString& name ) const
{
if ( scriptChain )
***************
*** 331,335 ****
Adds an event handler to this object
*/
! void cUObject::addEvent( cPythonScript* event, bool append )
{
if ( isScriptChainFrozen() )
--- 331,335 ----
Adds an event handler to this object
*/
! void cUObject::addScript( cPythonScript* event, bool append )
{
if ( isScriptChainFrozen() )
***************
*** 338,342 ****
}
! if ( hasEvent( event->name() ) )
{
return;
--- 338,342 ----
}
! if ( hasScript( event->name() ) )
{
return;
***************
*** 385,389 ****
Removes an event handler from the object
*/
! void cUObject::removeEvent( const QString& name )
{
if ( isScriptChainFrozen() )
--- 385,389 ----
Removes an event handler from the object
*/
! void cUObject::removeScript( const QString& name )
{
if ( isScriptChainFrozen() )
***************
*** 392,396 ****
}
! if ( !hasEvent( name ) )
{
return;
--- 392,396 ----
}
! if ( !hasScript( name ) )
{
return;
***************
*** 405,409 ****
if ( count == 1 )
{
! clearEvents();
}
else
--- 405,409 ----
if ( count == 1 )
{
! clearScripts();
}
else
***************
*** 517,524 ****
}
}
! // <events>a,b,c</events>
! else if ( TagName == "events" )
{
! setEventList( Value );
}
else
--- 517,524 ----
}
}
! // <scripts>a,b,c</scripts>
! else if ( TagName == "scripts" )
{
! setScriptList( Value );
}
else
***************
*** 730,736 ****
// \property object.eventlist This string property contains a comma separated list of the names of the scripts that are assigned to this object.
! else if ( name == "eventlist" )
{
! clearEvents();
QStringList list = QStringList::split( ",", value.toString() );
for ( QStringList::const_iterator it( list.begin() ); it != list.end(); ++it )
--- 730,736 ----
// \property object.eventlist This string property contains a comma separated list of the names of the scripts that are assigned to this object.
! else if ( name == "scriptlist" )
{
! clearScripts();
QStringList list = QStringList::split( ",", value.toString() );
for ( QStringList::const_iterator it( list.begin() ); it != list.end(); ++it )
***************
*** 738,742 ****
cPythonScript* script = ScriptManager::instance()->find( ( *it ).latin1() );
if ( script )
! addEvent( script );
else
PROPERTY_ERROR( -3, QString( "Script not found: '%1'" ).arg( *it ) )
--- 738,742 ----
cPythonScript* script = ScriptManager::instance()->find( ( *it ).latin1() );
if ( script )
! addScript( script );
else
PROPERTY_ERROR( -3, QString( "Script not found: '%1'" ).arg( *it ) )
***************
*** 765,769 ****
PY_PROPERTY( "name", this->name() )
PY_PROPERTY( "pos", pos() )
! PY_PROPERTY( "eventlist", eventList() )
// \rproperty object.multi This item property contains the multi this object is contained in.
PY_PROPERTY( "multi", multi_ )
--- 765,769 ----
PY_PROPERTY( "name", this->name() )
PY_PROPERTY( "pos", pos() )
! PY_PROPERTY( "scriptlist", scriptList() )
// \rproperty object.multi This item property contains the multi this object is contained in.
PY_PROPERTY( "multi", multi_ )
***************
*** 1023,1027 ****
}
! QString cUObject::eventList() const
{
if ( !scriptChain )
--- 1023,1027 ----
}
! QString cUObject::scriptList() const
{
if ( !scriptChain )
***************
*** 1048,1052 ****
}
! void cUObject::setEventList( const QString& eventlist )
{
if ( isScriptChainFrozen() )
--- 1048,1052 ----
}
! void cUObject::setScriptList( const QString& eventlist )
{
if ( isScriptChainFrozen() )
***************
*** 1059,1063 ****
QStringList::iterator it;
! clearEvents();
scriptChain = new cPythonScript * [1 + events.count()];
scriptChain[0] = reinterpret_cast<cPythonScript*>( 0 );
--- 1059,1063 ----
QStringList::iterator it;
! clearScripts();
scriptChain = new cPythonScript * [1 + events.count()];
scriptChain[0] = reinterpret_cast<cPythonScript*>( 0 );
Index: uobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v
retrieving revision 1.106
retrieving revision 1.107
diff -C2 -d -r1.106 -r1.107
*** uobject.h 25 Aug 2004 00:41:25 -0000 1.106
--- uobject.h 25 Aug 2004 17:01:23 -0000 1.107
***************
*** 108,121 ****
// Event Management Methods
! void clearEvents();
! void addEvent( cPythonScript * Event, bool append = false );
! void removeEvent( const QString& Name );
! bool hasEvent( const QString& Name ) const;
void freezeScriptChain();
void unfreezeScriptChain();
bool isScriptChainFrozen();
! void setEventList( const QString& events );
! QString eventList() const;
! inline cPythonScript** getEvents()
{
return scriptChain;
--- 108,121 ----
// Event Management Methods
! void clearScripts();
! void addScript( cPythonScript * script, bool append = false );
! void removeScript( const QString& Name );
! bool hasScript( const QString& Name ) const;
void freezeScriptChain();
void unfreezeScriptChain();
bool isScriptChainFrozen();
! void setScriptList( const QString& scripts );
! QString scriptList() const;
! inline cPythonScript** getScripts()
{
return scriptChain;
Index: wolfpack.vcproj
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.vcproj,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** wolfpack.vcproj 18 Aug 2004 17:05:46 -0000 1.44
--- wolfpack.vcproj 25 Aug 2004 17:01:29 -0000 1.45
***************
*** 826,830 ****
Filter="">
<File
! RelativePath=".\twofish\twofish2.c">
</File>
</Filter>
--- 826,830 ----
Filter="">
<File
! RelativePath=".\twofish\twofish2.cpp">
</File>
</Filter>
Index: timers.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timers.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** timers.cpp 22 Aug 2004 02:29:51 -0000 1.11
--- timers.cpp 25 Aug 2004 17:01:23 -0000 1.12
***************
*** 275,279 ****
void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, const QString& type, bool silent, bool onlyDispellable )
{
! /*if (cPythonScript::canChainHandleEvent(EVENT_DISPEL, pc_dest->getEvents())) {
PyObject *source;
if (pSource) {
--- 275,279 ----
void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, const QString& type, bool silent, bool onlyDispellable )
{
! /*if (cPythonScript::canChainHandleEvent(EVENT_DISPEL, pc_dest->getScripts())) {
PyObject *source;
if (pSource) {
***************
*** 289,293 ****
PyObject *args = Py_BuildValue("(NNBBsN", pc_dest->getPyObject(), source,
silent ? 1 : 0, onlyDispellable ? 0 : 1, ptype, PyTuple_New(0));
! bool result = cPythonScript::callChainedEventHandler(EVENT_DISPEL, pc_dest->getEvents(), args);
Py_DECREF(args);
if (result) {
--- 289,293 ----
PyObject *args = Py_BuildValue("(NNBBsN", pc_dest->getPyObject(), source,
silent ? 1 : 0, onlyDispellable ? 0 : 1, ptype, PyTuple_New(0));
! bool result = cPythonScript::callChainedEventHandler(EVENT_DISPEL, pc_dest->getScripts(), args);
Py_DECREF(args);
if (result) {
***************
*** 322,326 ****
void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, bool silent )
{
! if ( cPythonScript::canChainHandleEvent( EVENT_DISPEL, pc_dest->getEvents() ) )
{
PyObject* source;
--- 322,326 ----
void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, bool silent )
{
! if ( cPythonScript::canChainHandleEvent( EVENT_DISPEL, pc_dest->getScripts() ) )
{
PyObject* source;
***************
*** 336,340 ****
PyObject* args = Py_BuildValue( "(NNBBsN", pc_dest->getPyObject(), source, silent ? 1 : 0, 0, "", PyTuple_New( 0 ) );
! bool result = cPythonScript::callChainedEventHandler( EVENT_DISPEL, pc_dest->getEvents(), args );
Py_DECREF( args );
--- 336,340 ----
PyObject* args = Py_BuildValue( "(NNBBsN", pc_dest->getPyObject(), source, silent ? 1 : 0, 0, "", PyTuple_New( 0 ) );
! bool result = cPythonScript::callChainedEventHandler( EVENT_DISPEL, pc_dest->getScripts(), args );
Py_DECREF( args );
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.185
retrieving revision 1.186
diff -C2 -d -r1.185 -r1.186
*** speech.cpp 19 Aug 2004 01:59:15 -0000 1.185
--- speech.cpp 25 Aug 2004 17:01:23 -0000 1.186
***************
*** 259,263 ****
continue;
! cPythonScript** events = pNpc->getEvents();
if ( events )
--- 259,263 ----
continue;
! cPythonScript** events = pNpc->getScripts();
if ( events )
Index: walking.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v
retrieving revision 1.137
retrieving revision 1.138
diff -C2 -d -r1.137 -r1.138
*** walking.cpp 22 Aug 2004 02:29:51 -0000 1.137
--- walking.cpp 25 Aug 2004 17:01:24 -0000 1.138
***************
*** 236,240 ****
{
// Doors can be passed by ghosts
! if ( pItem->hasEvent( "door" ) )
{
continue;
--- 236,240 ----
{
// Doors can be passed by ghosts
! if ( pItem->hasScript( "door" ) )
{
continue;
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.439
retrieving revision 1.440
diff -C2 -d -r1.439 -r1.440
*** items.cpp 22 Aug 2004 02:29:50 -0000 1.439
--- items.cpp 25 Aug 2004 17:01:23 -0000 1.440
***************
*** 193,197 ****
// Copy Events
scriptChain = 0;
! setEventList( src.eventList() );
this->name_ = src.name_;
this->tags_ = src.tags_;
--- 193,197 ----
// Copy Events
scriptChain = 0;
! setScriptList( src.scriptList() );
this->name_ = src.name_;
this->tags_ = src.tags_;
***************
*** 647,651 ****
}
! clearEvents();
removeFromView( false ); // Remove it from all clients in range
free = true;
--- 647,651 ----
}
! clearScripts();
removeFromView( false ); // Remove it from all clients in range
free = true;
***************
*** 2189,2193 ****
// Do some basic checks and see if the item is a
// container (they never stack).
! if ( id() != pItem->id() || color() != pItem->color() || type() == 1 || type() != pItem->type() || bindmenu() != pItem->bindmenu() || eventList() != pItem->eventList() || baseid() != pItem->baseid() )
{
return false;
--- 2189,2193 ----
// Do some basic checks and see if the item is a
// container (they never stack).
! if ( id() != pItem->id() || color() != pItem->color() || type() == 1 || type() != pItem->type() || bindmenu() != pItem->bindmenu() || scriptList() != pItem->scriptList() || baseid() != pItem->baseid() )
{
return false;
***************
*** 2304,2308 ****
P_ITEM pCont = dynamic_cast<P_ITEM>( container_ );
! if ( pCont->hasEvent( "lock" ) )
{
return true;
--- 2304,2308 ----
P_ITEM pCont = dynamic_cast<P_ITEM>( container_ );
! if ( pCont->hasScript( "lock" ) )
{
return true;
|