'D'ropping gold messes up inventory

- 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
This commit is contained in:
cohrs
2002-02-25 05:51:44 +00:00
parent 0763523fba
commit 63908bbed4

View File

@@ -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);