]> granicus.if.org Git - nethack/commitdiff
'D'ropping gold messes up inventory
authorcohrs <cohrs>
Mon, 25 Feb 2002 05:51:44 +0000 (05:51 +0000)
committercohrs <cohrs>
Mon, 25 Feb 2002 05:51:44 +0000 (05:51 +0000)
- new splitobj() behavior requires special casing when !GOLDOBJ and
  dropping some of your gold, to ensure that the remainder remains the first
  item in the inventory

src/do.c

index ff8fabfb6cb9d255b107f6f2a9667edab5813ea1..75c96c3dcdd2f9acdf69ea156e5c5a06938f7c60 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -671,6 +671,11 @@ int retry;
                cnt = pick_list[i].count;
                if (cnt < otmp->quan && !welded(otmp) &&
                        (!otmp->cursed || otmp->otyp != LOADSTONE)) {
+#ifndef GOLDOBJ
+                   if (otmp->oclass == GOLD_CLASS)
+                       (void) splitobj(otmp, otmp->quan - cnt);
+                   else
+#endif
                    otmp = splitobj(otmp, cnt);
                }
                n_dropped += drop(otmp);