[wpdev-commits] wolfpack/network uosocket.cpp,1.430,1.431
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-10-17 01:20:29
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24680/network Modified Files: uosocket.cpp Log Message: housing updates Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.430 retrieving revision 1.431 diff -C2 -d -r1.430 -r1.431 *** uosocket.cpp 16 Oct 2004 14:06:31 -0000 1.430 --- uosocket.cpp 17 Oct 2004 01:20:20 -0000 1.431 *************** *** 1459,1462 **** --- 1459,1463 ---- contextMenu_.clear(); unsigned int i = 0; + unsigned int totalCount = 0; for ( ; menuIt != bindMenus.end(); ++menuIt ) { *************** *** 1481,1487 **** enabled = false; menuPacket.addEntry( i, ( *it )->cliloc(), enabled ? ( *it )->flags() : ( *it )->flags() | 0x0001, ( *it )->color() ); } } ! if ( i ) // Won't send empty menus send( &menuPacket ); } --- 1482,1489 ---- enabled = false; menuPacket.addEntry( i, ( *it )->cliloc(), enabled ? ( *it )->flags() : ( *it )->flags() | 0x0001, ( *it )->color() ); + totalCount++; } } ! if ( i && totalCount ) // Won't send empty menus send( &menuPacket ); } *************** *** 3098,3101 **** --- 3100,3118 ---- bool cUOSocket::useItem( P_ITEM item ) { + P_ITEM outmostItem = item->getOutmostItem(); + + cMulti *multi = outmostItem->multi(); + + // Check security if using items within a multi + if (multi && multi->canHandleEvent(EVENT_CHECKSECURITY)) { + PyObject *args = Py_BuildValue("(NNN)", _player->getPyObject(), multi->getPyObject(), outmostItem->getPyObject()); + bool result = multi->callEventHandler(EVENT_CHECKSECURITY, args); + Py_DECREF(args); + + if (result) { + return false; // Access Denied + } + } + if (item->type() != 1 && !item->corpse()) { if ( !_player->isGM() && _player->objectDelay() >= Server::instance()->time() ) *************** *** 3161,3174 **** } - // Secure containers - if ( item->isLockedDown() && item->secured() ) - { - if ( !_player->owns( item ) && !_player->isGM() ) - { - sysMessage( tr( "That is a secured chest!" ) ); - return true; - } - } - // Dead ppl can only use ankhs if ( _player->isDead() && item->type() != 16 ) --- 3178,3181 ---- |