item.noblock = false; items.append( item ); }  else if ( tile.flag2 & 0x2 ) { item.bottom = mitem.z + pMulti->pos().z; item.top = item.bottom + ( ( tile.flag2 & 0x04 ) ? ( tile.height / 2 ) : tile.height ); item.id = mitem.tile; item.noblock = true;
void getBlockingTiles( const Coord& pos, QValueList<stBlockingItem>& items ){	stBlockingItem item;	// Maptiles first	Maps::instance()->mapTileSpan( pos, item.id, item.bottom, item.top );	item.maptile = true;	// Only include this maptile if it's relevant for our line of sight	if ( item.id != 2 && item.id != 0x1DB && ( item.id <0x1AE || item.id> 0x1B5 ) )	{		items.append( item );	}	item.maptile = false;	// Search for statics at the same position	StaticsIterator statics = Maps::instance()->staticsIterator( pos, true );	// Find blocking statics	for ( ; !statics.atEnd(); ++statics )	{		const staticrecord &sitem = *statics;		tile_st tile = TileCache::instance()->getTile( sitem.itemid );		if ( tile.flag2 & 0x30 )		{			item.bottom = sitem.zoff;			// Bridges are only half as high			item.top = item.bottom + ( ( tile.flag2 & 0x04 ) ? ( tile.height / 2 ) : tile.height );			item.id = sitem.itemid;			items.append( item );		}	}	// Search for items at the given location	MapItemsIterator itemIter = MapObjects::instance()->listItemsAtCoord( pos );	for ( P_ITEM pItem = itemIter.first(); pItem; pItem = itemIter.next() )	{		// If the item is invisible or a multi, skip past it.		if ( pItem->isMulti() )			continue;		tile_st tile = TileCache::instance()->getTile( pItem->id() );		// Window and noshoot tiles block		if ( tile.flag2 & 0x30 )		{			item.id = pItem->id();			item.bottom = pItem->pos().z;			// Bridges are only half as high			item.top = item.bottom + ( ( tile.flag2 & 0x04 ) ? ( tile.height / 2 ) : tile.height );			items.append( item );		}	}	// Check for multis around the area	MapMultisIterator multis = MapObjects::instance()->listMultisInCircle( pos, BUILDRANGE );	// Check if there is an intersecting item for this multi	for ( P_MULTI pMulti = multis.first(); pMulti; pMulti = multis.next() )	{		// Get all items for this multi		MultiDefinition *data = MultiCache::instance()->getMulti( pMulti->id() - 0x4000 );		if ( data )		{			QValueVector<multiItem_st> mitems = data->getEntries();			QValueVector<multiItem_st>::iterator it;			for ( it = mitems.begin(); it != mitems.end(); ++it )			{				multiItem_st mitem = *it;				// Skip this multi tile if it's not at the position we need it to be				if ( !mitem.visible || pMulti->pos().x + mitem.x != pos.x || pMulti->pos().y + mitem.y != pos.y )				{					continue;				}				tile_st tile = TileCache::instance()->getTile( mitem.tile );				// Has to be blocking				if ( tile.flag2 & 0x30 )				{					item.bottom = mitem.z + pMulti->pos().z;					item.top = item.bottom + ( ( tile.flag2 & 0x04 ) ? ( tile.height / 2 ) : tile.height );					item.id = mitem.tile;					items.append( item );				}			}		}	}}