diff -c oldsrc/iedit.c src/iedit.c
*** oldsrc/iedit.c	Sun Jul 23 14:05:58 1995
--- src/iedit.c	Tue Nov 21 00:26:06 1995
***************
*** 21,26 ****
--- 21,28 ----
  extern char    *drinks[];
  extern char    *apply_types[];
  extern char    *container_bits[];
+ extern struct board_info_type board_info[NUM_OF_BOARDS];
+ extern struct obj_data *object_list;
  
  /* for spell list */
  extern char    *spells[];
***************
*** 490,500 ****
--- 492,504 ----
  	  obj_proto[obj_number].item_number = obj_number;
  	} else {
  	  /* uhoh.. need to make a new place in the object prototype table */
+ 	  int realcounter;
  	  int             counter;
  	  int             found = FALSE;
  
  	  struct obj_data *new_obj_proto;
  	  struct index_data *new_obj_index;
+ 	  struct obj_data *temp_obj;
  
  	  /* + 2.. strange but true */
  	  CREATE(new_obj_index, struct index_data, top_of_objt + 2);
***************
*** 546,562 ****
  	    new_obj_proto[top_of_objt + 1] = *(d->edit_obj);
  	    new_obj_proto[top_of_objt + 1].in_room = NOWHERE;
  	    new_obj_proto[top_of_objt + 1].item_number = top_of_objt + 1;
  	  }
  	  top_of_objt++;
  
  	  /* free and replace old tables */
! 	  free(obj_proto);
! 	  free(obj_index);
  	  obj_proto = new_obj_proto;
  	  obj_index = new_obj_index;
  	}
! 	send_to_char("Do you wish to write this object to disk?\r\n", d->character);
! 	d->edit_mode = IEDIT_CONFIRM_SAVEDB;
        }
        break;
      case 'n':
--- 550,695 ----
  	    new_obj_proto[top_of_objt + 1] = *(d->edit_obj);
  	    new_obj_proto[top_of_objt + 1].in_room = NOWHERE;
  	    new_obj_proto[top_of_objt + 1].item_number = top_of_objt + 1;
+ 	    /* it is now safe (and necessary!) to assign real number to
+ 	     * the edit_obj, which has been -1 all this time */
+ 	    d->edit_obj->item_number = top_of_objt + 1;
  	  }
  	  top_of_objt++;
  
+ 	  
+ 	  /* we also have to renumber all the objects currently
+ 	     existing in the world. This is because when I start
+ 	     extracting objects, bad things will happen! */
+ 	  for (temp_obj = object_list; temp_obj; temp_obj = temp_obj->next)
+ 	    if (GET_OBJ_RNUM (temp_obj) >= d->edit_obj->item_number)
+ 	      GET_OBJ_RNUM (temp_obj)++;
+ 
  	  /* free and replace old tables */
! 	  free (obj_proto);
! 	  free (obj_index);
  	  obj_proto = new_obj_proto;
  	  obj_index = new_obj_index;
+ 
+ 	  /* RENUMBER ZONE TABLES HERE, only
+ 	     because I ADDED an object!
+ 	     This code shamelessly ripped off from db.c */
+ 	  {
+ 	    extern int top_of_zone_table;
+ 	    int zone, cmd_no;
+ 	    for (zone = 0; zone <= top_of_zone_table; zone++)
+ 	      for (cmd_no = 0; zone_table[zone].cmd[cmd_no].command != 'S'; cmd_no++)
+ 		{
+ 		  switch (zone_table[zone].cmd[cmd_no].command)
+ 		    {
+ 		      case 'O':
+ 			zone_table[zone].cmd[cmd_no].arg1 =
+ 			  (zone_table[zone].cmd[cmd_no].arg1 >= d->edit_obj->item_number ?
+ 			   zone_table[zone].cmd[cmd_no].arg1 + 1 : zone_table[zone].cmd[cmd_no].arg1);
+ 			break;
+ 		      case 'G':
+ 			zone_table[zone].cmd[cmd_no].arg1 =
+ 			  (zone_table[zone].cmd[cmd_no].arg1 >= d->edit_obj->item_number ?
+ 			   zone_table[zone].cmd[cmd_no].arg1 + 1 : zone_table[zone].cmd[cmd_no].arg1);
+ 			break;
+ 		      case 'E':
+ 			zone_table[zone].cmd[cmd_no].arg1 =
+ 			  (zone_table[zone].cmd[cmd_no].arg1 >= d->edit_obj->item_number ?
+ 			   zone_table[zone].cmd[cmd_no].arg1 + 1 : zone_table[zone].cmd[cmd_no].arg1);
+ 			break;
+ 		      case 'P':
+ 			zone_table[zone].cmd[cmd_no].arg1 =
+ 			  (zone_table[zone].cmd[cmd_no].arg1 >= d->edit_obj->item_number ?
+ 			   zone_table[zone].cmd[cmd_no].arg1 + 1 : zone_table[zone].cmd[cmd_no].arg1);
+ 			zone_table[zone].cmd[cmd_no].arg3 =
+ 			  (zone_table[zone].cmd[cmd_no].arg3 >= d->edit_obj->item_number ?
+ 			   zone_table[zone].cmd[cmd_no].arg3 + 1 : zone_table[zone].cmd[cmd_no].arg3);
+ 			break;
+ 		      case 'R':	/* rem obj from room */
+ 			zone_table[zone].cmd[cmd_no].arg2 =
+ 			  (zone_table[zone].cmd[cmd_no].arg2 >= d->edit_obj->item_number ?
+ 			   zone_table[zone].cmd[cmd_no].arg2 + 1 : zone_table[zone].cmd[cmd_no].arg2);
+ 			break;
+ 		    }
+ 		}
+ 	  }
+ 	  /* this fixes the creeping board problems */
+ 	  realcounter = real_object (d->edit_number);
+ 	  for (counter = 0; counter < NUM_OF_BOARDS; counter++)
+ 	    {
+ 	      if (BOARD_RNUM (counter) >= realcounter)
+ 		BOARD_RNUM (counter) = BOARD_RNUM (counter) + 1;
+ 	    }
+ 	}  /* end of obj insertion */
+ 
+ 	send_to_char("Writing object to disk..", d->character);
+ 	{
+ 	  int             counter, counter2, realcounter;
+ 	  FILE           *fp;
+ 	  struct obj_data *obj;
+ 	  struct extra_descr_data *ex_desc;
+ 
+ 	  /* i want to use "obj" instead of just obj_proto[] because some of
+ 	   * the macros assume it's a pointer instead of just a struct as
+ 	   * obj_proto is, plus it's short to type in :P */
+ 	  CREATE(obj, struct obj_data, 1);
+ 
+ 	  sprintf(buf, "%s/%d.obj", OBJ_PREFIX,
+ 		  zone_table[d->edit_zone].number);
+ 	  fp = fopen(buf, "w+");
+ 
+ 	  /* start running through all objects in this zone */
+ 	  for (counter = zone_table[d->edit_zone].number * 100;
+ 	       counter <= zone_table[d->edit_zone].top;
+ 	       counter++) {
+ 	    /* write object to disk */
+ 	    realcounter = real_object(counter);
+ 	    if (realcounter >= 0) {
+ 	      *obj = obj_proto[realcounter];
+ 	      fprintf(fp, "#%d\n", GET_OBJ_VNUM(obj));
+ 	      fprintf(fp, "%s~\n", obj->name);
+ 	      fprintf(fp, "%s~\n", obj->short_description);
+ 	      fprintf(fp, "%s~\n", obj->description);
+ 	      if (obj->action_description)
+ 		fprintf(fp, "%s~\n", obj->action_description);
+ 	      else
+ 		fprintf(fp, "~\n");
+ 	      fprintf(fp, "%d %d %d\n", GET_OBJ_TYPE(obj),
+ 		      GET_OBJ_EXTRA(obj), GET_OBJ_WEAR(obj));
+ 	      fprintf(fp, "%d %d %d %d\n", GET_OBJ_VAL(obj, 0),
+ 		      GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 2),
+ 		      GET_OBJ_VAL(obj, 3));
+ 	      fprintf(fp, "%d %d %d\n", GET_OBJ_WEIGHT(obj),
+ 		      GET_OBJ_COST(obj), GET_OBJ_RENT(obj));
+ 	      /* do we have extra descriptions? */
+ 	      if (obj->ex_description) {
+ 		for (ex_desc = obj->ex_description; ex_desc; ex_desc = ex_desc->next) {
+ 		  fprintf(fp, "E\n");
+ 		  fprintf(fp, "%s~\n", ex_desc->keyword);
+ 		  fprintf(fp, "%s~\n", ex_desc->description);
+ 		}
+ 	      }
+ 	      /* do we have affects? */
+ 	      for (counter2 = 0; counter2 < MAX_OBJ_AFFECT; counter2++) {
+ 		if (obj->affected[counter2].modifier) {
+ 		  fprintf(fp, "A\n");
+ 		  fprintf(fp, "%d %d\n", obj->affected[counter2].location,
+ 			  obj->affected[counter2].modifier);
+ 		}
+ 	      }
+ 	    }
+ 	  }
+ 	  /* write final line, close */
+ 	  fprintf(fp, "$~\n");
+ 	  fclose(fp);
+ 	  /* nuke temp object */
+ 	  free_obj(obj);
  	}
! 	if (d->edit_obj)
! 	  free_obj(d->edit_obj);
! 	d->edit_obj = NULL;
! 	STATE(d) = CON_PLAYING;
! 	REMOVE_BIT(PLR_FLAGS(d->character), PLR_EDITING);
! 	send_to_char("Done.\r\n", d->character);
        }
        break;
      case 'n':
***************
*** 578,676 ****
      }
      break;			/* end of IEDIT_CONFIRM_SAVESTRING */
  
-   case IEDIT_CONFIRM_SAVEDB:
-     switch (*arg) {
-     case 'y':
-     case 'Y':
-       send_to_char("Writing object to disk..", d->character);
-       {
- 	int             counter, counter2, realcounter;
- 	FILE           *fp;
- 	struct obj_data *obj;
- 	struct extra_descr_data *ex_desc;
- 
- 	/* i want to use "obj" instead of just obj_proto[] because some of
- 	 * the macros assume it's a pointer instead of just a struct as
- 	 * obj_proto is, plus it's short to type in :P */
- 	CREATE(obj, struct obj_data, 1);
- 
- 	sprintf(buf, "%s/%d.obj", OBJ_PREFIX,
- 		zone_table[d->edit_zone].number);
- 	fp = fopen(buf, "w+");
- 
- 	/* start running through all objects in this zone */
- 	for (counter = zone_table[d->edit_zone].number * 100;
- 	     counter <= zone_table[d->edit_zone].top;
- 	     counter++) {
- 	  /* write object to disk */
- 	  realcounter = real_object(counter);
- 	  if (realcounter >= 0) {
- 	    *obj = obj_proto[realcounter];
- 	    fprintf(fp, "#%d\n", GET_OBJ_VNUM(obj));
- 	    fprintf(fp, "%s~\n", obj->name);
- 	    fprintf(fp, "%s~\n", obj->short_description);
- 	    fprintf(fp, "%s~\n", obj->description);
- 	    if (obj->action_description)
- 	      fprintf(fp, "%s~\n", obj->action_description);
- 	    else
- 	      fprintf(fp, "~\n");
- 	    fprintf(fp, "%d %d %d\n", GET_OBJ_TYPE(obj),
- 		    GET_OBJ_EXTRA(obj), GET_OBJ_WEAR(obj));
- 	    fprintf(fp, "%d %d %d %d\n", GET_OBJ_VAL(obj, 0),
- 		    GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 2),
- 		    GET_OBJ_VAL(obj, 3));
- 	    fprintf(fp, "%d %d %d\n", GET_OBJ_WEIGHT(obj),
- 		    GET_OBJ_COST(obj), GET_OBJ_RENT(obj));
- 	    /* do we have extra descriptions? */
- 	    if (obj->ex_description) {
- 	      for (ex_desc = obj->ex_description; ex_desc; ex_desc = ex_desc->next) {
- 		fprintf(fp, "E\n");
- 		fprintf(fp, "%s~\n", ex_desc->keyword);
- 		fprintf(fp, "%s~\n", ex_desc->description);
- 	      }
- 	    }
- 	    /* do we have affects? */
- 	    for (counter2 = 0; counter2 < MAX_OBJ_AFFECT; counter2++) {
- 	      if (obj->affected[counter2].modifier) {
- 		fprintf(fp, "A\n");
- 		fprintf(fp, "%d %d\n", obj->affected[counter2].location,
- 			obj->affected[counter2].modifier);
- 	      }
- 	    }
- 	  }
- 	}
- 	/* write final line, close */
- 	fprintf(fp, "$~\n");
- 	fclose(fp);
- 	/* nuke temp object */
- 	free_obj(obj);
-       }
-       if (d->edit_obj)
- 	free_obj(d->edit_obj);
-       d->edit_obj = NULL;
-       STATE(d) = CON_PLAYING;
-       REMOVE_BIT(PLR_FLAGS(d->character), PLR_EDITING);
-       send_to_char("Done.\r\n", d->character);
-       break;
-     case 'n':
-     case 'N':
-       send_to_char("Not saved to DB.\r\n", d->character);
-       send_to_char("This object is available until the next reboot.\r\n", d->character);
-       if (d->edit_obj)
- 	free_obj(d->edit_obj);
-       d->edit_obj = NULL;
-       STATE(d) = CON_PLAYING;
-       REMOVE_BIT(PLR_FLAGS(d->character), PLR_EDITING);
-       send_to_char("Done.\r\n", d->character);
-       break;
-     default:
-       send_to_char("Invalid choice!\r\n", d->character);
-       send_to_char("Do you wish to write this object to disk?\r\n", d->character);
-       break;
- 
-     }
-     break;			/* end of IEDIT_CONFIRM_SAVEDB */
- 
    case IEDIT_MAIN_MENU:
      /* throw us out to whichever edit mode based on user input */
      switch (*arg) {
--- 711,716 ----
***************
*** 1016,1023 ****
      case 3:
        /* if keyword or description has not been changed don't allow person to
         * edit next */
!       if (!((struct extra_descr_data *) d->misc_data)->keyword ||
! 	  !((struct extra_descr_data *) d->misc_data)->description) {
  	send_to_char("You can't edit the next extra desc  without completing this one.\r\n", d->character);
  	iedit_disp_extradesc_menu(d);
        } else {
--- 1056,1063 ----
      case 3:
        /* if keyword or description has not been changed don't allow person to
         * edit next */
!       if (!((struct extra_descr_data *) *d->misc_data)->keyword ||
! 	  !((struct extra_descr_data *) *d->misc_data)->description) {
  	send_to_char("You can't edit the next extra desc  without completing this one.\r\n", d->character);
  	iedit_disp_extradesc_menu(d);
        } else {
diff -c oldsrc/redit.c src/redit.c
*** oldsrc/redit.c	Sun Jul 23 14:05:57 1995
--- src/redit.c	Tue Nov 21 00:28:48 1995
***************
*** 245,348 ****
        break;
      }
      break; /* end of REDIT_CONFIRM_EDIT */
-   case REDIT_CONFIRM_SAVEDB:
-     switch (*arg) {
-     case 'y':
-     case 'Y':
-       send_to_char("Writing room to disk.\r\n", d->character);
- 
-       {
- 	/* this code writes the entire zone containing
- 	   the edited room to disk */
- 	int             counter, counter2, realcounter;
- 	FILE           *fp;
- 	struct room_data *room;
- 	struct extra_descr_data *ex_desc;
- 
- 	/* not really necessary, but I"m lazy :) */
- 	CREATE(room, struct room_data, 1);
- 
- 	sprintf(buf, "%s/%d.wld", WLD_PREFIX,
- 		zone_table[d->edit_zone].number);
- 	fp = fopen(buf, "w+");
- 	for (counter = zone_table[d->edit_zone].number * 100;
- 	     counter <= zone_table[d->edit_zone].top;
- 	     counter++) {
- 	  realcounter = real_room(counter);
- 	  if (realcounter >= 0) {
- 	    *room = world[realcounter];
- 	    fprintf(fp, "#%d\n", counter);
- 	    fprintf(fp, "%s~\n", room->name);
- 	    fprintf(fp, "%s~\n", room->description);
- 	    fprintf(fp, "%d %d %d\n",
- 		    zone_table[room->zone].number,
- 		    room->room_flags, room->sector_type);
- 	    for (counter2 = 0; counter2 < NUM_OF_DIRS; counter2++) {
- 	      if (room->dir_option[counter2]) {
- 		int             temp_door_flag;
- 		fprintf(fp, "D%d\n", counter2);
- 		fprintf(fp, "%s~\n",
- 			room->dir_option[counter2]->general_description ?
- 			room->dir_option[counter2]->general_description :
- 			"");
- 		fprintf(fp, "%s~\n", room->dir_option[counter2]->keyword ?
- 			room->dir_option[counter2]->keyword :
- 			"");
- 		/* door flags need special handling, unfortunately. argh! */
- 		if (IS_SET(room->dir_option[counter2]->exit_info, EX_ISDOOR)) {
- 		  if (IS_SET(room->dir_option[counter2]->exit_info, EX_PICKPROOF))
- 		    temp_door_flag = 2;
- 		  else
- 		    temp_door_flag = 1;
- 		} else
- 		  temp_door_flag = 0;
- 		fprintf(fp, "%d %d %d\n",
- 			temp_door_flag,
- 			room->dir_option[counter2]->key,
- 			room->dir_option[counter2]->to_room_vnum);
- 	      }
- 	    }
- 	    if (room->ex_description) {
- 	      for (ex_desc = room->ex_description; ex_desc; ex_desc = ex_desc->next) {
- 		fprintf(fp, "E\n");
- 		fprintf(fp, "%s~\n", ex_desc->keyword);
- 		fprintf(fp, "%s~\n", ex_desc->description);
- 	      }
- 	    }
- 	    fprintf(fp, "S\n");
- 	  }
- 	}
- 	/* free temporary */
- 	free(room);
- 	/* write final line and close */
- 	fprintf(fp, "$~\n");
- 	fclose(fp);
- 	send_to_char("Saved.\r\n", d->character);
- 	/* do NOT free strings! just the room structure */
- 	free(d->edit_room);
- 	d->edit_room = NULL;
- 	REMOVE_BIT(PLR_FLAGS(d->character), PLR_EDITING);
- 	STATE(d) = CON_PLAYING;
- 	send_to_char("Done.\r\n", d->character);
-       }
-       break;
-     case 'n':
-     case 'N':
-       send_to_char("Room not saved to disk, available until next reboot.\r\n", d->character);
-       /* I can free the room structure, but I cannot free the string / exit
-        * pointers! */
-       free(d->edit_room);
-       d->edit_room = NULL;
-       REMOVE_BIT(PLR_FLAGS(d->character), PLR_EDITING);
-       STATE(d) = CON_PLAYING;
-       send_to_char("Done.\r\n", d->character);
-       break;
-     default:
-       send_to_char("Invalid choice!\r\n", d->character);
-       send_to_char("Do you wish to write this room to disk?", d->character);
-       break;
-     }
-     break; /* end of REDIT_CONFIRM_SAVEDB */
    case REDIT_CONFIRM_SAVESTRING:
      switch (*arg) {
      case 'y':
--- 245,250 ----
***************
*** 405,415 ****
  	      struct obj_data *temp_obj;
  	      /* check if current virtual is bigger than our virtual */
  	      if (world[counter].number > d->edit_number) {
- 		/* eureka! insert now */
- 		new_world[counter] = *(d->edit_room);
- 		new_world[counter].number = d->edit_number;
- 		new_world[counter].func = NULL;
- 		found = 1;
  		/* people in this room must have their numbers moved */
  		for (temp_ch = world[counter].people; temp_ch;
  		     temp_ch = temp_ch->next_in_room)
--- 307,312 ----
***************
*** 420,425 ****
--- 317,328 ----
  		     temp_obj = temp_obj->next_content)
  		  if (temp_obj->in_room != -1)
  		    temp_obj->in_room = counter + 1;
+ 		/* eureka! insert now */
+ 		new_world[counter] = *(d->edit_room);
+ 		new_world[counter].number = d->edit_number;
+ 		new_world[counter].func = NULL;
+ 		found = 1;
+ 		
  		/* copy from world to new_world + 1 */
  		new_world[counter + 1] = world[counter];
  	      } else {
***************
*** 444,459 ****
  	      new_world[counter + 1] = world[counter];
  	    }
  	  }
  	  top_of_world++;
  	  /* copy world table over */
  	  free(world);
  	  world = new_world;
- 	  /* we have to update the start rooms */
- 	  r_mortal_start_room = real_room(mortal_start_room);
- 	  r_immort_start_room = real_room(immort_start_room);
- 	  r_frozen_start_room = real_room(frozen_start_room);
  	  /* now this is the *real* room_num */
  	  room_num = real_room(d->edit_number);
  	  /* go through the world. if any of the old rooms indicated an exit
  	   * to our new room, we have to change it */
  	  for (counter = 0; counter < top_of_world + 1; counter++)
--- 347,412 ----
  	      new_world[counter + 1] = world[counter];
  	    }
  	  }
+ 	  /* if place not found, insert at end */
+ 	  if (!found)
+ 	    {
+ 	      new_world[top_of_world + 1] = *d->edit_room;
+ 	      new_world[top_of_world + 1].number = d->edit_number;
+ 	      new_world[top_of_world + 1].func = NULL;
+ 	    }
  	  top_of_world++;
  	  /* copy world table over */
  	  free(world);
  	  world = new_world;
  	  /* now this is the *real* room_num */
  	  room_num = real_room(d->edit_number);
+ 	  /* update zone tables */
+ 	  {
+ 	    extern int top_of_zone_table;
+ 	    int zone, cmd_no;
+ 
+ 	    for (zone = 0; zone <= top_of_zone_table; zone++)
+ 	      for (cmd_no = 0; zone_table[zone].cmd[cmd_no].command != 'S'; cmd_no++)
+ 		{
+ 		  switch (zone_table[zone].cmd[cmd_no].command)
+ 		    {
+ 		      case 'M':
+ 			zone_table[zone].cmd[cmd_no].arg3 =
+ 			  (zone_table[zone].cmd[cmd_no].arg3 >= room_num ?
+ 			   zone_table[zone].cmd[cmd_no].arg3 + 1 : zone_table[zone].cmd[cmd_no].arg3);
+ 			break;
+ 		      case 'O':
+ 			if (zone_table[zone].cmd[cmd_no].arg3 != NOWHERE)
+ 			  zone_table[zone].cmd[cmd_no].arg3 =
+ 			    (zone_table[zone].cmd[cmd_no].arg3 >= room_num ?
+ 			     zone_table[zone].cmd[cmd_no].arg3 + 1 : zone_table[zone].cmd[cmd_no].arg3);
+ 			break;
+ 		      case 'D':
+ 			zone_table[zone].cmd[cmd_no].arg1 =
+ 			  (zone_table[zone].cmd[cmd_no].arg1 >= room_num ?
+ 			   zone_table[zone].cmd[cmd_no].arg1 + 1 : zone_table[zone].cmd[cmd_no].arg1);
+ 			break;
+ 		      case 'R':	/* rem obj from room */
+ 			zone_table[zone].cmd[cmd_no].arg1 =
+ 			  (zone_table[zone].cmd[cmd_no].arg1 >= room_num ?
+ 			   zone_table[zone].cmd[cmd_no].arg1 + 1 : zone_table[zone].cmd[cmd_no].arg1);
+ 			break;
+ 		      case 'T':
+ 			zone_table[zone].cmd[cmd_no].arg1 =
+ 			  (zone_table[zone].cmd[cmd_no].arg1 >= room_num ?
+ 			   zone_table[zone].cmd[cmd_no].arg1 + 1 : zone_table[zone].cmd[cmd_no].arg1);
+ 			break;
+ 		    }
+ 		}
+ 	  }
+ 
+ 	  /* update load rooms, to fix creeping load room problem */
+ 	  if (room_num <=r_mortal_start_room)
+ 	    r_mortal_start_room++;
+ 	  if (room_num <=r_immort_start_room)
+ 	    r_immort_start_room++;
+ 	  if (room_num <=r_frozen_start_room)
+ 	    r_frozen_start_room++;
  	  /* go through the world. if any of the old rooms indicated an exit
  	   * to our new room, we have to change it */
  	  for (counter = 0; counter < top_of_world + 1; counter++)
***************
*** 480,488 ****
  	    }
  	  }
  	}
! 	send_to_char("Do you want to write this room to disk?\r\n",
! 		     d->character);
! 	d->edit_mode = REDIT_CONFIRM_SAVEDB;
        }
        break;
      case 'n':
--- 433,513 ----
  	    }
  	  }
  	}
!       }
!       send_to_char("Writing room to disk.\r\n", d->character);
!       {
! 	/* this code writes the entire zone containing
! 	   the edited room to disk */
! 	int             counter, counter2, realcounter;
! 	FILE           *fp;
! 	struct room_data *room;
! 	struct extra_descr_data *ex_desc;
! 
! 	/* not really necessary, but I"m lazy :) */
! 	CREATE(room, struct room_data, 1);
! 
! 	sprintf(buf, "%s/%d.wld", WLD_PREFIX,
! 		zone_table[d->edit_zone].number);
! 	fp = fopen(buf, "w+");
! 	for (counter = zone_table[d->edit_zone].number * 100;
! 	     counter <= zone_table[d->edit_zone].top;
! 	     counter++) {
! 	  realcounter = real_room(counter);
! 	  if (realcounter >= 0) {
! 	    *room = world[realcounter];
! 	    fprintf(fp, "#%d\n", counter);
! 	    fprintf(fp, "%s~\n", room->name);
! 	    fprintf(fp, "%s~\n", room->description);
! 	    fprintf(fp, "%d %d %d\n",
! 		    zone_table[room->zone].number,
! 		    room->room_flags, room->sector_type);
! 	    for (counter2 = 0; counter2 < NUM_OF_DIRS; counter2++) {
! 	      if (room->dir_option[counter2]) {
! 		int             temp_door_flag;
! 		fprintf(fp, "D%d\n", counter2);
! 		fprintf(fp, "%s~\n",
! 			room->dir_option[counter2]->general_description ?
! 			room->dir_option[counter2]->general_description :
! 			"");
! 		fprintf(fp, "%s~\n", room->dir_option[counter2]->keyword ?
! 			room->dir_option[counter2]->keyword :
! 			"");
! 		/* door flags need special handling, unfortunately. argh! */
! 		if (IS_SET(room->dir_option[counter2]->exit_info, EX_ISDOOR)) {
! 		  if (IS_SET(room->dir_option[counter2]->exit_info, EX_PICKPROOF))
! 		    temp_door_flag = 2;
! 		  else
! 		    temp_door_flag = 1;
! 		} else
! 		  temp_door_flag = 0;
! 		fprintf(fp, "%d %d %d\n",
! 			temp_door_flag,
! 			room->dir_option[counter2]->key,
! 			room->dir_option[counter2]->to_room_vnum);
! 	      }
! 	    }
! 	    if (room->ex_description) {
! 	      for (ex_desc = room->ex_description; ex_desc; ex_desc = ex_desc->next) {
! 		fprintf(fp, "E\n");
! 		fprintf(fp, "%s~\n", ex_desc->keyword);
! 		fprintf(fp, "%s~\n", ex_desc->description);
! 	      }
! 	    }
! 	    fprintf(fp, "S\n");
! 	  }
! 	}
! 	/* free temporary */
! 	free(room);
! 	/* write final line and close */
! 	fprintf(fp, "$~\n");
! 	fclose(fp);
! 	send_to_char("Saved.\r\n", d->character);
! 	/* do NOT free strings! just the room structure */
! 	free(d->edit_room);
! 	d->edit_room = NULL;
! 	REMOVE_BIT(PLR_FLAGS(d->character), PLR_EDITING);
! 	STATE(d) = CON_PLAYING;
! 	send_to_char("Done.\r\n", d->character);
        }
        break;
      case 'n':
***************
*** 730,737 ****
        d->mail_to = 0;
        break;
      case 3:
!       if (!((struct extra_descr_data *) d->misc_data)->keyword ||
! 	  !((struct extra_descr_data *) d->misc_data)->description) {
  	send_to_char("You can't edit the next extra desc without completing this one.\r\n", d->character);
  	redit_disp_extradesc_menu(d);
        } else {
--- 755,762 ----
        d->mail_to = 0;
        break;
      case 3:
!       if (!((struct extra_descr_data *) *d->misc_data)->keyword ||
! 	  !((struct extra_descr_data *) *d->misc_data)->description) {
  	send_to_char("You can't edit the next extra desc without completing this one.\r\n", d->character);
  	redit_disp_extradesc_menu(d);
        } else {
