else if ( pChar->isDead() )
else if ( pChar && pChar->isDead() )
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() );	}	RegionIterator4Items iIter( pos );	for ( iIter.Begin(); !iIter.atEnd(); iIter++ )	{		P_ITEM pItem = iIter.GetData();		if ( !pItem )			continue;		if ( pItem->id() >= 0x4000 )		{			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;		}		else if ( pChar->isDead() )		{			// Doors can be passed by ghosts			if ( pItem->hasScript( "door" ) )			{				continue;			}		}		// They need to be at the same x,y,plane coords		if ( ( pItem->pos().x != pos.x ) || ( pItem->pos().y != pos.y ) || ( pItem->pos().map != pos.map ) )			continue;		tile_st tTile = TileCache::instance()->getTile( pItem->id() );		// Se 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() );	}	// Now we need to evaluate dynamic items [...] (later)	// TODO: Multis here	sort_heap( blockList.begin(), blockList.end(), compareTiles() );	return blockList;};