]> granicus.if.org Git - nethack/commitdiff
containers and objects in special level descriptions
authorcohrs <cohrs>
Sun, 14 Jul 2002 20:17:45 +0000 (20:17 +0000)
committercohrs <cohrs>
Sun, 14 Jul 2002 20:17:45 +0000 (20:17 +0000)
On mazelike levels, containers had to be listed before their objects.  But,
for roomfilled levels, containers had to be listed _after_ the objects.  All
our current levels that use containers with objects are mazelike, so I
changed the room behavior, updating the comment in lev_comp.y to match.
Other items/monsters are still processed in reverse on roomfilled special
levels, but I think this is OK.

doc/fixes34.1
src/sp_lev.c
util/lev_comp.y

index c21d027b88b94cac85e1658de6e5876aab76215e..dee7569bcce1edff8ef1943b0d77e12569927ab4 100644 (file)
@@ -165,6 +165,7 @@ in some situations, if hero stood still, a hostile dwarf would switch back
        and forth between weapon and pick-axe and never move
 uncontrolled teleports did not handle leashed pets
 minetown fountain warnings shouldn't prevent finding gems/coins in fountain
+order of container and objects was different for mazelike and roomfilled levels
 
 
 Platform- and/or Interface-Specific Fixes
index e86923d5b4408def5b58dfbe7fba9af8346769ff..5aa1027423227279ce9cb017a6cf2cf99afafd80 100644 (file)
@@ -1953,13 +1953,13 @@ dlb *fd;
                } else
                    r->monsters = 0;
 
-               /* read the objects */
+               /* read the objects, in same order as mazes */
                Fread((genericptr_t) &r->nobject, 1, sizeof(r->nobject), fd);
                if ((n = r->nobject) != 0) {
                    r->objects = NewTab(object, n);
-                   while (n--) {
-                       r->objects[(int)n] = New(object);
-                       load_one_object(fd, r->objects[(int)n]);
+                   for (j = 0; j < n; ++j) {
+                       r->objects[j] = New(object);
+                       load_one_object(fd, r->objects[j]);
                    }
                } else
                    r->objects = 0;
index 2e872b80dab8cc8c80640ea76fea18db489ba05d..e4cb5100003527dc703987e9ee011f2bdd186484 100644 (file)
@@ -877,7 +877,7 @@ object_detail       : OBJECT_ID object_desc
                  }
                | COBJECT_ID object_desc
                  {
-                       /* 1: is contents of next object with 2 */
+                       /* 1: is contents of preceeding object with 2 */
                        /* 2: is a container */
                        /* 0: neither */
                        tmpobj[nobj-1]->containment = 2;