Fix typo and type mismatch.
[open-adventure.git] / init.c
diff --git a/init.c b/init.c
index fe373f37fbd078ecbd6251bc8d08f8ae91868252..194abe3488aa6d7255982bec0eec30b3fa7d986b 100644 (file)
--- a/init.c
+++ b/init.c
@@ -38,19 +38,18 @@ void initialise(void)
      *  This also sets up "game.place" and "fixed" as copies of "PLAC" and
      *  "FIXD".  Also, since two-placed objects are typically best
      *  described last, we'll drop them first. */
-    for (int i = 1; i <= NOBJECTS; i++) {
-        int k = NOBJECTS + 1 - i;
-        if (FIXD[k] > 0) {
-            DROP(k + NOBJECTS, FIXD[k]);
-            DROP(k, PLAC[k]);
+    for (int i = NOBJECTS; i >= 1; i--) {
+        if (object_descriptions[i].fixd > 0) {
+            DROP(i + NOBJECTS, object_descriptions[i].fixd);
+            DROP(i, object_descriptions[i].plac);
         }
     }
 
     for (int i = 1; i <= NOBJECTS; i++) {
         int k = NOBJECTS + 1 - i;
-        game.fixed[k] = FIXD[k];
-        if (PLAC[k] != 0 && FIXD[k] <= 0)
-            DROP(k, PLAC[k]);
+        game.fixed[k] = object_descriptions[k].fixd;
+        if (object_descriptions[k].plac != 0 && object_descriptions[k].fixd <= 0)
+            DROP(k, object_descriptions[k].plac);
     }
 
     /*  Treasure props are initially -1, and are set to 0 the first time