[wpdev-commits] wolfpack/network uosocket.cpp,1.433,1.434
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-10-29 23:44:21
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20446/network Modified Files: uosocket.cpp Log Message: Source Updates for Player vendors. Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.433 retrieving revision 1.434 diff -C2 -d -r1.433 -r1.434 *** uosocket.cpp 26 Oct 2004 18:37:35 -0000 1.433 --- uosocket.cpp 29 Oct 2004 23:44:05 -0000 1.434 *************** *** 3129,3148 **** } ! // Cant use stuff that isn't in your pack. ! if ( item->container() && item->container()->isItem() && item->type() != 1 && !item->isInWorld() ) { ! P_CHAR pc_p = item->getOutmostChar(); ! if ( pc_p && _player != pc_p ) ! return false; } ! else if ( item->container() && item->container()->isChar() && item->type() != 1 && !item->isInWorld() ) ! { ! // in a character. ! P_CHAR pc_p = dynamic_cast<P_CHAR>( item->container() ); ! if ( pc_p != NULL ) ! if ( pc_p != _player && item->layer() != 15 && item->type() != 1 ) ! return false; } // Criminal for looting an innocent corpse & unhidden if not owner... if ( item->corpse() ) --- 3129,3170 ---- } ! // Dead ppl can only use ankhs ! if ( _player->isDead() && item->type() != 16 ) { ! sysMessage( tr( "Your ghostly hand passes trough the object." ) ); ! return false; } ! ! // Cant use stuff that isn't in your pack. ! P_CHAR pOutmostChar = item->getOutmostChar(); ! ! // It's not a container and not on use, assume it has a special behaviour that is not activated ! // using snooping ! if (pOutmostChar && pOutmostChar != _player && item->type() != 1) { ! bool allowed = false; ! ! PyObject *args = Py_BuildValue("(NN)", _player->getPyObject(), item->getPyObject()); ! ! if (_player->callEventHandler(EVENT_REMOTEUSE, args)) { ! allowed = true; ! } ! ! if (!allowed && pOutmostChar->callEvent(EVENT_REMOTEUSE, args)) { ! allowed = true; ! } ! ! Py_DECREF(args); ! ! if (!allowed) ! return false; } + // Call both events here + if ( _player->onUse( item ) ) + return true; + + if ( item->onUse( _player ) ) + return true; + // Criminal for looting an innocent corpse & unhidden if not owner... if ( item->corpse() ) *************** *** 3182,3192 **** } - // Dead ppl can only use ankhs - if ( _player->isDead() && item->type() != 16 ) - { - sysMessage( tr( "Your ghostly hand passes trough the object." ) ); - return false; - } - // You can only use equipment on your own char if ( !_player->isGM() && item->container() && item->container()->isChar() && item->container() != _player ) --- 3204,3207 ---- *************** *** 3199,3209 **** } - // Call both events here - if ( _player->onUse( item ) ) - return true; - - if ( item->onUse( _player ) ) - return true; - // Check item behaviour by it's tpye switch ( item->type() ) --- 3214,3217 ---- |