blockItem.height = tTile.height;
blockItem.height = (tTile.flag2 & 0x04) ? (tTile.height / 2) : tTile.height;
vector< stBlockItem > getBlockingItems( P_CHAR pChar, const Coord_cl& pos ){	vector<stBlockItem> blockList;	make_heap( blockList.begin(), blockList.end(), compareTiles() );	// Process the map at that position	stBlockItem mapBlock;	mapBlock.maptile = true;	mapBlock.z = Maps::instance()->mapAverageElevation( pos );	mapBlock.height = 0;	// TODO: Calculate the REAL average Z Value of that Map Tile here! Otherwise clients will have minor walking problems.	map_st mapCell = Maps::instance()->seekMap( pos );	//mapBlock.z = mapCell.z;	land_st mapTile = TileCache::instance()->getLand( mapCell.id );	// If it's not impassable it's automatically walkable	if ( !( mapTile.flag1 & 0x40 ) )		mapBlock.walkable = true;	else		mapBlock.walkable = checkWalkable( pChar, mapCell.id );	if ( mapCell.id != 0x02 )	{		blockList.push_back( mapBlock );		push_heap( blockList.begin(), blockList.end(), compareTiles() );	}	// Now for the static-items	StaticsIterator staIter = Maps::instance()->staticsIterator( pos, true );	for ( ; !staIter.atEnd(); ++staIter )	{		tile_st tTile = TileCache::instance()->getTile( staIter->itemid );		// Here is decided if the tile is needed		// It's uninteresting if it's NOT blocking		// And NOT a bridge/surface		if ( !( ( tTile.flag2 & 0x02 ) || ( tTile.flag1 & 0x40 ) || ( tTile.flag2 & 0x04 ) ) )			continue;		stBlockItem staticBlock;		staticBlock.z = staIter->zoff;		// If we are a surface we can always walk here, otherwise check if		// we are special		if ( ( tTile.flag2 & 0x02 ) && !( tTile.flag1 & 0x40 ) )			staticBlock.walkable = true;		else			staticBlock.walkable = checkWalkable( pChar, staIter->itemid );		// If we are a stair only the half height counts (round up)		if ( tTile.flag2 & 0x04 )			staticBlock.height = ( Q_UINT8 ) ( ( tTile.height + 1 ) / 2 );		else			staticBlock.height = tTile.height;		blockList.push_back( staticBlock );		push_heap( blockList.begin(), blockList.end(), compareTiles() );	}		// We are only interested in items at pos	// todo: we could impliment blocking for items on the adjacent sides 	// during a diagonal move here, but this has yet to be decided.	RegionIterator4Items iIter( pos, 0 );  		P_ITEM pItem;	for ( iIter.Begin(); !iIter.atEnd(); iIter++ )	{		pItem = iIter.GetData();		if ( !pItem )			continue;				if ( pChar && pChar->isDead() )		{			// Doors can be passed by ghosts			if ( pItem->hasScript( "door" ) )			{				continue;			}		}		tile_st tTile = TileCache::instance()->getTile( pItem->id() );		// See above for what the flags mean		if ( !( ( tTile.flag2 & 0x02 ) || ( tTile.flag1 & 0x40 ) || ( tTile.flag2 & 0x04 ) ) )			continue;		stBlockItem blockItem;		blockItem.height = tTile.height;		blockItem.z = pItem->pos().z;		// Once again: see above for a description of this part		if ( ( tTile.flag2 & 0x02 ) && !( tTile.flag1 & 0x40 ) )			blockItem.walkable = true;		else			blockItem.walkable = checkWalkable( pChar, pItem->id() );		blockList.push_back( blockItem );		push_heap( blockList.begin(), blockList.end(), compareTiles() );	}			// deal with the multis now, or not.	cItemSectorIterator* iter = SectorMaps::instance()->findMultis( pos, 18 );  // 18 has been tested with castle sides and corners...	for ( pItem = iter->first(); pItem; pItem = iter->next() )	{		MultiDefinition* def = MultiCache::instance()->getMulti( pItem->id() - 0x4000 );		if ( !def )			continue;		QValueVector<multiItem_st> multi = def->getEntries();		unsigned int j;		for ( j = 0; j < multi.size(); ++j )		{			if ( multi[j].visible && ( pItem->pos().x + multi[j].x == pos.x ) && ( pItem->pos().y + multi[j].y == pos.y ) )			{				tile_st tTile = TileCache::instance()->getTile( multi[j].tile );				if ( !( ( tTile.flag2 & 0x02 ) || ( tTile.flag1 & 0x40 ) || ( tTile.flag2 & 0x04 ) ) )					continue;				stBlockItem blockItem;				blockItem.height = tTile.height;				blockItem.z = pItem->pos().z + multi[j].z;				if ( ( tTile.flag2 & 0x02 ) && !( tTile.flag1 & 0x40 ) )					blockItem.walkable = true;				else					blockItem.walkable = checkWalkable( pChar, pItem->id() );				blockList.push_back( blockItem );				push_heap( blockList.begin(), blockList.end(), compareTiles() );			}		}		continue;	}	delete iter;	 		// Now we need to evaluate dynamic items [...] (later)  ??	sort_heap( blockList.begin(), blockList.end(), compareTiles() );	return blockList;};