if( wearer->online() ) wearer->socket()->sysMessage( tr( "You cannot wear that item.") );
if( wearer->objectType() == enPlayer ) { P_PLAYER pp = dynamic_cast<P_PLAYER>(wearer); if( pp->socket() ) pp->socket()->sysMessage( tr( "You cannot wear that item.") ); }
void equipItem( P_CHAR wearer, P_ITEM item ){	tile_st tile = TileCache::instance()->getTile( item->id() );	// User cannot wear the item	if( tile.layer == 0 )	{		if( wearer->online() )			wearer->socket()->sysMessage( tr( "You cannot wear that item.") );		item->toBackpack( wearer );		return;	}	cChar::ContainerContent container = wearer->content();	cChar::ContainerContent::const_iterator it(container.begin());	for( ; it != container.end(); ++it )	{		P_ITEM equip = *it; 				// Unequip the item and free the layer that way		if( equip && ( equip->layer() == tile.layer ) )			equip->toBackpack( wearer );		wearer->removeItemBonus( equip );	}	// *finally* equip the item	wearer->addItem( static_cast<cChar::enLayer>(item->layer()), item );	// Add the item bonuses	wearer->giveItemBonus( item );}