OSDN Git Service

upgrade to 3.6.2
[jnethack/source.git] / src / o_init.c
index 7ea54e5..9557f9a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 o_init.c        $NHDT-Date: 1450318588 2015/12/17 02:16:28 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */
+/* NetHack 3.6 o_init.c        $NHDT-Date: 1545383615 2018/12/21 09:13:35 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.25 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2011. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -369,8 +369,12 @@ boolean credit_hero;
             if (credit_hero)
                 exercise(A_WIS, TRUE);
         }
-        if (moves > 1L)
+        /* moves==1L => initial inventory, gameover => final disclosure */
+        if (moves > 1L && !program_state.gameover) {
+            if (objects[oindx].oc_class == GEM_CLASS)
+                gem_learned(oindx); /* could affect price of unpaid gems */
             update_inventory();
+        }
     }
 }
 
@@ -397,6 +401,9 @@ register int oindx;
             disco[dindx - 1] = 0;
         else
             impossible("named object not in disco");
+
+        if (objects[oindx].oc_class == GEM_CLASS)
+            gem_learned(oindx); /* ok, it's actually been unlearned */
         update_inventory();
     }
 }