Re: OasisOLC v2.0-pre6 (Still getting there)

From: George Greer (greerga@circlemud.org)
Date: 05/14/99


On Fri, 14 May 1999, Fionn Colvin wrote:

>(1) I don't know if this is implemented yet or not. But if I make an object
>in a zone that doesn't currently have an obj file. Like oedit 1200, it
>creates the 12.obj file no probs, but doesn't add 12.obj to the index list.

'zedit new' is supposed to do that.

500H 100M 82V > oedit 100
Sorry, there is no zone for that number!

>(2) If I edit an item thats I'm currently wearing it gets all wacked up. If I
>remove and purge it. Then reload it, its fine however.

Yup.  The problem is that the behavior of the funtions changed between
v1.6b and v2.0.  Where the old code never free()'d the OLC structure
strings, the new code makes a str_dup() of it and removes the entire OLC
instance.

diff -up OasisOLCv2.0-pre6/genobj.c OasisOLCv2.0-pre7/genobj.c
--- OasisOLCv2.0-pre6/genobj.c  Thu May 13 21:18:31 1999
+++ OasisOLCv2.0-pre7/genobj.c  Fri May 14 03:29:34 1999
@@ -42,6 +42,8 @@ obj_rnum add_object(struct obj_data *new
   if ((newobj->item_number = real_object(ovnum)) != NOTHING) {
     struct obj_data swap;

+    copy_object(&obj_proto[newobj->item_number], newobj);
+
     /*
      * We need to run through each and every object currently in the
      * game to see which ones are pointing to this prototype.
@@ -54,12 +56,11 @@ obj_rnum add_object(struct obj_data *new

       /* We know that 'obj->item_number == new_obj->item_number' now. */
       swap = *obj;
-      *obj = *newobj;
+      *obj = obj_proto[newobj->item_number];
       /*
        * Copy game-time dependent variables over.
        */
       obj->in_room = swap.in_room;
-      obj->item_number = newobj->item_number;
       obj->carried_by = swap.carried_by;
       obj->worn_by = swap.worn_by;
       obj->worn_on = swap.worn_on;
@@ -69,7 +70,6 @@ obj_rnum add_object(struct obj_data *new
       obj->next = swap.next;
     }

-    copy_object(&obj_proto[newobj->item_number], newobj);
     add_to_save_list(zone_table[rznum].number, SL_OBJ);
     return TRUE;
   }

--
George Greer            | Sammy's Code - OBuild
greerga@circlemud.org   | http://www.ticnet.com/samedi/code.html


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST