@Override
	public void giveASky(int depth)
	{
		if(skyedYet)
			return;
		if(depth>1000)
			return;

		skyedYet=true;
		if((roomID().length()==0)
		&&(getGridParent()!=null)
		&&(getGridParent().roomID().length()==0))
			return;
		
		if((rawDoors()[Directions.UP]==null)
		&&((domainType()&Room.INDOORS)==0)
		&&(domainType()!=Room.DOMAIN_OUTDOORS_UNDERWATER)
		&&(domainType()!=Room.DOMAIN_OUTDOORS_AIR)
		&&(CMProps.getIntVar(CMProps.Int.SKYSIZE)!=0))
		{
			Exit upE=null;
			final Exit dnE=CMClass.getExit("StdOpenDoorway");
			if(CMProps.getIntVar(CMProps.Int.SKYSIZE)>0)
				upE=dnE;
			else
				upE=CMClass.getExit("UnseenWalkway");

			final GridLocale sky=(GridLocale)CMClass.getLocale("EndlessThinSky");
			sky.setRoomID("");
			sky.setArea(getArea());
			rawDoors()[Directions.UP]=sky;
			setRawExit(Directions.UP,upE);
			sky.rawDoors()[Directions.DOWN]=this;
			sky.setRawExit(Directions.DOWN,dnE);
			
			if(!(getArea() instanceof BoardableShip))
			{
				for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--)
				{
					if((d!=Directions.UP)&&(d!=Directions.DOWN))
					{
						Room thatRoom=rawDoors()[d];
						if((thatRoom!=null)&&(getRawExit(d)!=null))
						{
							thatRoom=CMLib.map().getRoom(thatRoom);
							if(thatRoom != null)
							{
								thatRoom.giveASky(depth+1);
								final Room thatSky=thatRoom.rawDoors()[Directions.UP];
								if((thatSky!=null)
								&&(thatSky.roomID().length()==0)
								&&((thatSky instanceof EndlessThinSky)||(thatSky instanceof EndlessSky)))
								{
									Exit xo=getRawExit(d);
									if(xo!=null)
									{
										if(xo.hasADoor())
											xo=dnE;
										sky.rawDoors()[d]=thatSky;
										sky.setRawExit(d,xo);
									}
									final int opDir=Directions.getOpDirectionCode(d);
									xo=thatRoom.getRawExit(opDir);
									if(xo!=null)
									{
										if(xo.hasADoor())
											xo=dnE;
										thatSky.rawDoors()[opDir]=sky;
										thatSky.setRawExit(opDir,xo);
									}
									((GridLocale)thatSky).clearGrid(null);
								}
							}
						}
					}
				}
			}
			sky.clearGrid(null);
		}
	}