Пример #1
0
        protected void ConvertDoor(BaseDoor door)
        {
            if (!Owned)
            {
                return;
            }

            if (door is ISecurable)
            {
                door.Locked = false;
                c_House.Doors.Add(door);
                return;
            }

            door.Open = false;

            var newdoor = new GenericHouseDoor(0, door.ClosedID, door.OpenedSound, door.ClosedSound)
            {
                Offset = door.Offset,
                ClosedID = door.ClosedID,
                OpenedID = door.OpenedID,
                Location = door.Location,
                Map = door.Map
            };

            door.Delete();

            foreach (
                Item inneritem in
                    newdoor.GetItemsInRange(1)
                        .Where(inneritem => inneritem is BaseDoor && inneritem != newdoor && inneritem.Z == newdoor.Z))
            {
                ((BaseDoor) inneritem).Link = newdoor;
                newdoor.Link = (BaseDoor) inneritem;
            }

            c_House.Doors.Add(newdoor);
        }
Пример #2
0
		protected void ConvertDoor( BaseDoor door )
		{
			if ( !Owned )
				return;

			if ( door is Server.Gumps.ISecurable )
			{
                Console.WriteLine("Convert Door 1");
				door.Locked = false;
				c_House.Doors.Add( door );
                return;
			}

			door.Open = false;

			GenericHouseDoor newdoor = new GenericHouseDoor( (DoorFacing)0, door.ClosedID, door.OpenedSound, door.ClosedSound );
			newdoor.Offset = door.Offset;
			newdoor.ClosedID = door.ClosedID;
			newdoor.OpenedID = door.OpenedID;
			newdoor.Location = door.Location;
			newdoor.Map = door.Map;

			door.Delete();

			foreach( Item inneritem in newdoor.GetItemsInRange( 1 ) )
				if ( inneritem is BaseDoor && inneritem != newdoor && inneritem.Z == newdoor.Z )
				{
					((BaseDoor)inneritem).Link = newdoor;
					newdoor.Link = (BaseDoor)inneritem;
				}

            Console.WriteLine("Convert Door 2");
            c_House.Doors.Add(newdoor);
        }