Re: OK, new Olc problem. hehe (Getting there. hehe)

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


On Fri, 14 May 1999, Fionn Colvin wrote:

><> load obj 1520
>There is no object with that number.

Do you wish to save this object internally? : y
Saving object to memory.
500H 100M 82V > vnum obj
Usage: vnum { obj | mob } <name>
500H 100M 82V > vnum obj new
  1. [   -1] a new object

D'oh.

Apply the following patch, or just pick up OasisOLC v2.0-pre6.

diff -uprN OasisOLCv2.0-pre5/genobj.c OasisOLCv2.0-pre6/genobj.c
--- OasisOLCv2.0-pre5/genobj.c  Sat Apr 24 13:42:51 1999
+++ OasisOLCv2.0-pre6/genobj.c  Thu May 13 21:18:31 1999
@@ -84,17 +84,16 @@ obj_rnum add_object(struct obj_data *new
   /*
    * Start counting through both tables.
    */
-  for (i = top_of_objt; i > 0; i++) {
+  for (i = top_of_objt; i > 0; i--) {
     /*
      * Check if current virtual is bigger than our virtual number.
      */
     if (ovnum > obj_index[i - 1].vnum) {
-      obj_index[i].vnum = newobj->item_number;
+      obj_index[i].vnum = found = newobj->item_number = i;
       obj_index[i].number = 0;
       obj_index[i].func = NULL;
       obj_proto[i] = *newobj;
       obj_proto[i].in_room = NOWHERE;
-      found = newobj->item_number = i;
       break;
     }

@@ -105,12 +104,11 @@ obj_rnum add_object(struct obj_data *new
   }

   if (!found) {
-    obj_index[0].vnum = newobj->item_number;
+    obj_index[0].vnum = newobj->item_number = found = 0;
     obj_index[0].number = 0;
     obj_index[0].func = NULL;
     obj_proto[0] = *newobj;
     obj_proto[0].in_room = NOWHERE;
-    found = newobj->item_number = 0;
   }

   /*

--
George Greer            | Death's Gate Scripts
greerga@circlemud.org   | http://www.mindspring.com/~heilpern/dg_scripts/


     +------------------------------------------------------------+
     | 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