From: Sean Hunt Date: Sat, 14 Feb 2015 06:31:22 +0000 (-0500) Subject: Make GOLDOBJ unconditional. X-Git-Tag: NetHack-3.6.0_RC01~664 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac108cd365b2193f24b5c797aac3203ca83977cd;p=nethack Make GOLDOBJ unconditional. --- diff --git a/include/config.h b/include/config.h index c89f778e3..1af4b0560 100644 --- a/include/config.h +++ b/include/config.h @@ -443,7 +443,6 @@ typedef unsigned char uchar; * bugs left here. */ -/*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ #define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */ #define STATUS_HILITES /* support hilites of status fields */ /* #define WINCHAIN*/ /* stacked window systems */ diff --git a/include/decl.h b/include/decl.h index ddc814f4d..1e882705f 100644 --- a/include/decl.h +++ b/include/decl.h @@ -180,9 +180,7 @@ E NEARDATA struct kinfo { char name[BUFSZ]; /* actual killer name */ } killer; -#ifdef GOLDOBJ E long done_money; -#endif E const char *configfile; E NEARDATA char plname[PL_NSIZ]; E NEARDATA char dogname[]; diff --git a/include/extern.h b/include/extern.h index fd4bc6520..492718730 100644 --- a/include/extern.h +++ b/include/extern.h @@ -803,9 +803,7 @@ E int FDECL(calc_capacity, (int)); E int NDECL(max_capacity); E boolean FDECL(check_capacity, (const char *)); E int FDECL(inv_cnt, (BOOLEAN_P)); -#ifdef GOLDOBJ E long FDECL(money_cnt, (struct obj *)); -#endif /* ### hacklib.c ### */ @@ -900,11 +898,6 @@ E boolean FDECL(obj_here, (struct obj *,int,int)); E boolean NDECL(wearing_armor); E boolean FDECL(is_worn, (struct obj *)); E struct obj *FDECL(g_at, (int,int)); -#ifndef GOLDOBJ -E struct obj *FDECL(mkgoldobj, (long)); -E struct obj *FDECL(insert_gold_into_invent, (BOOLEAN_P)); -E void NDECL(remove_gold_from_invent); -#endif E struct obj *FDECL(getobj, (const char *,const char *)); E int FDECL(ggetobj, (const char *,int (*)(OBJ_P),int,BOOLEAN_P,unsigned *)); E int FDECL(askchain, (struct obj **,const char *,int,int (*)(OBJ_P), @@ -1076,9 +1069,7 @@ E void FDECL(freemcorpsenm, (struct monst *)); E void FDECL(set_mimic_sym, (struct monst *)); E int FDECL(mbirth_limit, (int)); E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P)); -#ifdef GOLDOBJ E void FDECL(mkmonmoney, (struct monst *, long)); -#endif E int FDECL(bagotricks, (struct obj *,BOOLEAN_P,int *)); E boolean FDECL(propagate, (int, BOOLEAN_P,BOOLEAN_P)); E boolean FDECL(usmellmon, (struct permonst *)); @@ -1679,13 +1670,8 @@ E void NDECL(getlock); /* ### pickup.c ### */ -#ifdef GOLDOBJ E int FDECL(collect_obj_classes, (char *,struct obj *,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *)); -#else -E int FDECL(collect_obj_classes, - (char *,struct obj *,BOOLEAN_P,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *)); -#endif E boolean FDECL(rider_corpse_revival, (struct obj *,BOOLEAN_P)); E void FDECL(add_valid_menu_class, (int)); E boolean FDECL(allow_all, (struct obj *)); @@ -1926,9 +1912,6 @@ E int FDECL(validate, (int,const char *)); E void NDECL(reset_restpref); E void FDECL(set_restpref, (const char *)); E void FDECL(set_savepref, (const char *)); -#ifndef GOLDOBJ -E void FDECL(put_gold_back, (struct monst *)); -#endif /* ### rip.c ### */ @@ -2019,10 +2002,8 @@ E void FDECL(store_savefileinfo, (int)); /* ### shk.c ### */ -#ifdef GOLDOBJ E long FDECL(money2mon, (struct monst *, long)); E void FDECL(money2u, (struct monst *, long)); -#endif E void FDECL(shkgone, (struct monst *)); E void FDECL(set_residency, (struct monst *,BOOLEAN_P)); E void FDECL(replshk, (struct monst *,struct monst *)); @@ -2155,11 +2136,7 @@ E void FDECL(initialspell, (struct obj *)); #ifdef USE_TRAMPOLI E int NDECL(stealarm); #endif -#ifdef GOLDOBJ E long FDECL(somegold, (long)); -#else -E long NDECL(somegold); -#endif E void FDECL(stealgold, (struct monst *)); E void FDECL(remove_worn_item, (struct obj *,BOOLEAN_P)); E int FDECL(steal, (struct monst *, char *)); @@ -2169,9 +2146,7 @@ E void FDECL(maybe_absorb_item, (struct monst *,struct obj *,int,int)); E void FDECL(mdrop_obj, (struct monst *,struct obj *,BOOLEAN_P)); E void FDECL(mdrop_special_objs, (struct monst *)); E void FDECL(relobj, (struct monst *,int,BOOLEAN_P)); -#ifdef GOLDOBJ E struct obj *FDECL(findgold, (struct obj *)); -#endif /* ### steed.c ### */ diff --git a/include/monst.h b/include/monst.h index c451d374f..39e62f3e4 100644 --- a/include/monst.h +++ b/include/monst.h @@ -135,9 +135,6 @@ struct monst { long mtrapseen; /* bitmap of traps we've been trapped in */ long mlstmv; /* for catching up with lost time */ long mspare1; -#ifndef GOLDOBJ -#define mgold mspare1 -#endif struct obj *minvent; struct obj *mw; diff --git a/include/you.h b/include/you.h index c010abcb0..0c343b3c4 100644 --- a/include/you.h +++ b/include/you.h @@ -339,10 +339,6 @@ struct you { int ublessed, ublesscnt; /* blessing/duration from #pray */ long umoney0; long uspare1; -#ifndef GOLDOBJ -#define ugold uspare1 -#define ugold0 umoney0 -#endif long uexp, urexp; long ucleansed; /* to record moves when player was cleansed */ long usleep; /* sleeping; monstermove you last started */ diff --git a/src/apply.c b/src/apply.c index 1ab6153df..e92e6199f 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2026,9 +2026,6 @@ struct obj *tstone; static const char scritch[] = "\"scritch, scritch\""; static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 }; static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 }; -#ifndef GOLDOBJ - struct obj goldobj; -#endif /* in case it was acquired while blinded */ if (!Blind) tstone->dknown = 1; @@ -2039,17 +2036,6 @@ struct obj *tstone; Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan)); if ((obj = getobj(choices, stonebuf)) == 0) return; -#ifndef GOLDOBJ - if (obj->oclass == COIN_CLASS) { - u.ugold += obj->quan; /* keep botl up to date */ - goldobj = *obj; - goldobj.oextra = (struct oextra *)0; /* dealloc_obj(obj) will invalidate - the target of this copied ptr - here, so clear it out */ - dealloc_obj(obj); - obj = &goldobj; - } -#endif if (obj == tstone && obj->quan == 1L) { You_cant("rub %s on itself.", the(xname(obj))); @@ -2066,9 +2052,6 @@ struct obj *tstone; else pline("A sharp crack shatters %s%s.", (obj->quan > 1L) ? "one of " : "", the(xname(obj))); -#ifndef GOLDOBJ - /* assert(obj != &goldobj); */ -#endif useup(obj); return; } diff --git a/src/bones.c b/src/bones.c index 5607355ee..66a4d43f5 100644 --- a/src/bones.c +++ b/src/bones.c @@ -229,16 +229,6 @@ int x, y; else place_object(otmp, x, y); } -#ifndef GOLDOBJ - if(u.ugold) { - long ugold = u.ugold; - - if (mtmp) mtmp->mgold = ugold; - else if (cont) (void) add_to_container(cont, mkgoldobj(ugold)); - else (void)mkgold(ugold, x, y); - u.ugold = ugold; /* undo mkgoldobj()'s removal */ - } -#endif if (cont) cont->owt = weight(cont); } diff --git a/src/botl.c b/src/botl.c index 59c6078ac..ab02ae35b 100644 --- a/src/botl.c +++ b/src/botl.c @@ -159,13 +159,8 @@ botl_score() long deepest = deepest_lev_reached(FALSE); long utotal; -#ifndef GOLDOBJ - utotal = u.ugold + hidden_gold(); - if ((utotal -= u.ugold0) < 0L) utotal = 0L; -#else utotal = money_cnt(invent) + hidden_gold(); if ((utotal -= u.umoney0) < 0L) utotal = 0L; -#endif utotal += u.urexp + (50 * (deepest - 1)) + (deepest > 30 ? 10000 : deepest > 20 ? 1000*(deepest - 20) : 0); if (utotal < u.urexp) utotal = LONG_MAX; /* wrap around */ @@ -268,11 +263,7 @@ bot2() Sprintf(nb = eos(newbot2), "%s:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", encglyph(objnum_to_glyph(GOLD_PIECE)), -#ifndef GOLDOBJ - u.ugold, -#else money_cnt(invent), -#endif hp, hpmax, u.uen, u.uenmax, u.uac); if (Upolyd) @@ -709,12 +700,7 @@ bot() /* Gold */ - blstats[idx][BL_GOLD].a.a_long = -#ifndef GOLDOBJ - u.ugold; -#else - money_cnt(invent); -#endif + blstats[idx][BL_GOLD].a.a_long = money_cnt(invent); /* * The tty port needs to display the current symbol for gold * as a field header, so to accomodate that we pass gold with diff --git a/src/decl.c b/src/decl.c index d4892f9d4..47043d0cd 100644 --- a/src/decl.c +++ b/src/decl.c @@ -49,9 +49,7 @@ NEARDATA int doorindex = 0; NEARDATA char *save_cm = 0; NEARDATA struct kinfo killer = DUMMY; -#ifdef GOLDOBJ NEARDATA long done_money = 0; -#endif const char *nomovemsg = 0; NEARDATA char plname[PL_NSIZ] = DUMMY; /* player name */ NEARDATA char pl_character[PL_CSIZ] = DUMMY; diff --git a/src/detect.c b/src/detect.c index 93db6c77c..ecc4d3878 100644 --- a/src/detect.c +++ b/src/detect.c @@ -91,12 +91,7 @@ unsigned material; /* there's some object shown here */ if (oclass == ALL_CLASSES) { return((boolean)( !(level.objects[x][y] || /* stale if nothing here */ - ((mtmp = m_at(x,y)) != 0 && - ( -#ifndef GOLDOBJ - mtmp->mgold || -#endif - mtmp->minvent))))); + ((mtmp = m_at(x,y)) != 0 && ( mtmp->minvent))))); } else { if (material && objects[glyph_to_obj(glyph)].oc_material == material) { /* the object shown here is of interest because material matches */ @@ -115,19 +110,10 @@ unsigned material; for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere) if (o_in(otmp, oclass)) return FALSE; /* didn't find it; perhaps a monster is carrying it */ -#ifndef GOLDOBJ - if ((mtmp = m_at(x,y)) != 0) { - if (oclass == COIN_CLASS && mtmp->mgold) - return FALSE; - else for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) - if (o_in(otmp, oclass)) return FALSE; - } -#else if ((mtmp = m_at(x,y)) != 0) { for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) if (o_in(otmp, oclass)) return FALSE; } -#endif /* detection indicates removal of this object from the map */ return TRUE; } @@ -176,11 +162,7 @@ register struct obj *sobj; /* look for gold carried by monsters (might be in a container) */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; /* probably not needed in this case but... */ -#ifndef GOLDOBJ - if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#else if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#endif known = TRUE; goto outgoldmap; /* skip further searching */ } else for (obj = mtmp->minvent; obj; obj = obj->nobj) @@ -212,12 +194,7 @@ register struct obj *sobj; if (youmonst.data == &mons[PM_GOLD_GOLEM]) { Sprintf(buf, "You feel like a million %s!", currency(2L)); - } else if (hidden_gold() || -#ifndef GOLDOBJ - u.ugold) -#else - money_cnt(invent)) -#endif + } else if (hidden_gold() || money_cnt(invent)) Strcpy(buf, "You feel worried about your future financial situation."); else @@ -254,11 +231,7 @@ outgoldmap: } for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; /* probably overkill here */ -#ifndef GOLDOBJ - if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#else if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#endif struct obj gold; gold = zeroobj; /* ensure oextra is cleared too */ gold.otyp = GOLD_PIECE; @@ -460,11 +433,7 @@ int class; /* an object class, 0 for all */ } if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT && (!class || class == objects[mtmp->mappearance].oc_class)) || -#ifndef GOLDOBJ - (mtmp->mgold && (!class || class == COIN_CLASS))) { -#else (findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) { -#endif ct++; break; } @@ -546,11 +515,7 @@ int class; /* an object class, 0 for all */ temp.oy = mtmp->my; temp.corpsenm = PM_TENGU; /* if mimicing a corpse */ map_object(&temp, 1); -#ifndef GOLDOBJ - } else if (mtmp->mgold && (!class || class == COIN_CLASS)) { -#else } else if (findgold(mtmp->minvent) && (!class || class == COIN_CLASS)) { -#endif struct obj gold; gold = zeroobj; /* ensure oextra is cleared too */ gold.otyp = GOLD_PIECE; diff --git a/src/do.c b/src/do.c index c225000ef..981981293 100644 --- a/src/do.c +++ b/src/do.c @@ -28,11 +28,7 @@ static NEARDATA const char drop_types[] = int dodrop() { -#ifndef GOLDOBJ - int result, i = (invent || u.ugold) ? 0 : (SIZE(drop_types) - 1); -#else int result, i = (invent) ? 0 : (SIZE(drop_types) - 1); -#endif if (*u.ushops) sellobj_state(SELL_DELIBERATE); result = drop(getobj(&drop_types[i], "drop")); @@ -484,13 +480,9 @@ register struct obj *obj; if (levhack) ELevitation = W_ART; /* other than W_ARTI */ if(flags.verbose) You("drop %s.", doname(obj)); -#ifndef GOLDOBJ - if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj); -#else /* Ensure update when we drop gold objects */ if (obj->oclass == COIN_CLASS) context.botl = 1; freeinv(obj); -#endif hitfloor(obj); if (levhack) float_down(I_SPECIAL|TIMEOUT, W_ARTI|W_ART); return(1); @@ -509,13 +501,9 @@ void dropx(obj) register struct obj *obj; { -#ifndef GOLDOBJ - if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj); -#else /* Ensure update when we drop gold objects */ if (obj->oclass == COIN_CLASS) context.botl = 1; freeinv(obj); -#endif if (!u.uswallow) { if (ship_object(obj, u.ux, u.uy, FALSE)) return; if (IS_ALTAR(levl[u.ux][u.uy].typ)) @@ -653,17 +641,10 @@ int retry; int n, i, n_dropped = 0; long cnt; struct obj *otmp, *otmp2; -#ifndef GOLDOBJ - struct obj *u_gold = 0; -#endif menu_item *pick_list; boolean all_categories = TRUE; boolean drop_everything = FALSE; -#ifndef GOLDOBJ - /* put gold where inventory traversal will see it */ - if (u.ugold) u_gold = insert_gold_into_invent(TRUE); -#endif if (retry) { all_categories = (retry == -2); } else if (flags.menu_style == MENU_FULL) { @@ -749,11 +730,6 @@ int retry; /* same kludge as getobj(), for canletgo()'s use */ otmp->corpsenm = (int) cnt; /* don't split */ } else { -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) - (void) splitobj(otmp, otmp->quan - cnt); - else -#endif otmp = splitobj(otmp, cnt); } } @@ -765,10 +741,6 @@ int retry; } drop_done: -#ifndef GOLDOBJ - /* if we put gold into inventory above, take it back out now */ - if (u_gold) remove_gold_from_invent(); -#endif return n_dropped; } diff --git a/src/dog.c b/src/dog.c index fa9d1f99a..ff7dd525d 100644 --- a/src/dog.c +++ b/src/dog.c @@ -443,15 +443,6 @@ boolean with_you; } corpse = mkcorpstat(CORPSE, (struct monst *)0, mtmp->data, xlocale, ylocale, CORPSTAT_NONE); -#ifndef GOLDOBJ - if (mtmp->mgold) { - if (xlocale == 0 && ylocale == 0 && corpse) { - (void) get_obj_location(corpse, &xlocale, &ylocale, 0); - (void) mkgold(mtmp->mgold, xlocale, ylocale); - } - mtmp->mgold = 0L; - } -#endif mongone(mtmp); } } diff --git a/src/dogmove.c b/src/dogmove.c index 4300fb8de..0b6e7a6f8 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -26,9 +26,6 @@ struct monst *mon; struct obj *obj, *wep, dummy, *pickaxe, *unihorn, *key; -#ifndef GOLDOBJ - if (mon->mgold) return &zeroobj; /* pet has something to drop */ -#endif dummy = zeroobj; dummy.otyp = GOLD_PIECE; /* not STRANGE_OBJECT or tools of interest */ dummy.oartifact = 1; /* so real artifact won't override "don't keep it" */ diff --git a/src/dokick.c b/src/dokick.c index fb81ab5c4..b17379e07 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -322,11 +322,7 @@ register struct obj *gold; verbalize("Thank you for your contribution."); else verbalize("Thanks, scum!"); } else if (mtmp->isgd) { -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif /* Some of these are iffy, because a hostile guard won't become peaceful and resume leading hero out of the vault. If he did do that, player @@ -352,11 +348,7 @@ register struct obj *gold; goldreqd = 750L; if (goldreqd) { -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (value > goldreqd + (umoney + u.ulevel * rn2(5)) / ACURR(A_CHA)) mtmp->mpeaceful = TRUE; diff --git a/src/dothrow.c b/src/dothrow.c index 08e21d4f5..aedb4fc40 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -45,18 +45,6 @@ int shotlimit; boolean twoweap, weakmultishot; /* ask "in what direction?" */ -#ifndef GOLDOBJ - if (!getdir((char *)0)) { - if (obj->oclass == COIN_CLASS) { - u.ugold += obj->quan; - context.botl = 1; - dealloc_obj(obj); - } - return(0); - } - - if(obj->oclass == COIN_CLASS) return(throw_gold(obj)); -#else if (!getdir((char *)0)) { /* obj might need to be merged back into the singular gold object */ freeinv(obj); @@ -73,7 +61,6 @@ int shotlimit; possibly using a sling. */ if(obj->oclass == COIN_CLASS && obj != uquiver) return(throw_gold(obj)); -#endif if(!canletgo(obj,"throw")) return(0); @@ -1833,34 +1820,18 @@ throw_gold(obj) struct obj *obj; { int range, odx, ody; -#ifndef GOLDOBJ - long zorks = obj->quan; -#endif register struct monst *mon; if(!u.dx && !u.dy && !u.dz) { -#ifndef GOLDOBJ - u.ugold += obj->quan; - context.botl = 1; - dealloc_obj(obj); -#endif You("cannot throw gold at yourself."); return(0); } -#ifdef GOLDOBJ freeinv(obj); -#endif if(u.uswallow) { pline(is_animal(u.ustuck->data) ? "%s in the %s's entrails." : "%s into %s.", -#ifndef GOLDOBJ - "The gold disappears", mon_nam(u.ustuck)); - u.ustuck->mgold += zorks; - dealloc_obj(obj); -#else "The money disappears", mon_nam(u.ustuck)); add_to_minv(u.ustuck, obj); -#endif return(1); } diff --git a/src/eat.c b/src/eat.c index 196fb9e49..7259e6424 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1985,13 +1985,8 @@ eatspecial() /* called after eating non-food */ context.victual.o_id = 0; context.victual.eating = 0; if (otmp->oclass == COIN_CLASS) { -#ifdef GOLDOBJ if (carried(otmp)) useupall(otmp); -#else - if (otmp->where == OBJ_FREE) - dealloc_obj(otmp); -#endif else useupf(otmp, otmp->quan); vault_gd_watching(GD_EATGOLD); diff --git a/src/end.c b/src/end.c index c9fe47cb2..f7e7f5ec3 100644 --- a/src/end.c +++ b/src/end.c @@ -998,13 +998,8 @@ die: { int deepest = deepest_lev_reached(FALSE); -#ifndef GOLDOBJ - umoney = u.ugold; - tmp = u.ugold0; -#else umoney = money_cnt(invent); tmp = u.umoney0; -#endif umoney += hidden_gold(); /* accumulate gold from containers */ tmp = umoney - tmp; /* net gain */ @@ -1046,11 +1041,7 @@ die: /* update gold for the rip output, which can't use hidden_gold() (containers will be gone by then if bones just got saved...) */ -#ifndef GOLDOBJ - u.ugold = umoney; -#else done_money = umoney; -#endif /* clean up unneeded windows */ if (have_windows) { diff --git a/src/fountain.c b/src/fountain.c index 764ffb5a3..f167c09d4 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -452,14 +452,6 @@ register struct obj *obj; break; case 28: /* Strange feeling */ pline("An urge to take a bath overwhelms you."); -#ifndef GOLDOBJ - if (u.ugold > 10) { - u.ugold -= somegold() / 10; - You("lost some of your gold in the fountain!"); - CLEAR_FOUNTAIN_LOOTED(u.ux,u.uy); - exercise(A_WIS, FALSE); - } -#else { long money = money_cnt(invent); struct obj *otmp; @@ -479,7 +471,6 @@ register struct obj *obj; exercise(A_WIS, FALSE); } } -#endif break; case 29: /* You see coins */ diff --git a/src/hack.c b/src/hack.c index 66e0962e6..fafff35b6 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2540,22 +2540,10 @@ inv_weight() register struct obj *otmp = invent; register int wt = 0; -#ifndef GOLDOBJ - /* when putting stuff into containers, gold is inserted at the head - of invent for easier manipulation by askchain & co, but it's also - retained in u.ugold in order to keep the status line accurate; we - mustn't add its weight in twice under that circumstance */ - wt = (otmp && otmp->oclass == COIN_CLASS) ? 0 : - (int)((u.ugold + 50L) / 100L); -#endif while (otmp) { -#ifndef GOLDOBJ - if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data)) -#else if (otmp->oclass == COIN_CLASS) wt += (int)(((long)otmp->quan + 50L) / 100L); else if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data)) -#endif wt += otmp->owt; otmp = otmp->nobj; } @@ -2609,7 +2597,7 @@ const char *str; int inv_cnt(incl_gold) -boolean incl_gold; /* only meaningful for GOLDOBJ config */ +boolean incl_gold; { register struct obj *otmp = invent; register int ct = 0; @@ -2621,7 +2609,6 @@ boolean incl_gold; /* only meaningful for GOLDOBJ config */ return(ct); } -#ifdef GOLDOBJ /* Counts the money in an object chain. */ /* Intended use is for your or some monsters inventory, */ /* now that u.gold/m.gold is gone.*/ @@ -2637,6 +2624,5 @@ struct obj *otmp; } return 0L; } -#endif /* GOLDOBJ */ /*hack.c*/ diff --git a/src/invent.c b/src/invent.c index 5778135d9..7a7a83734 100644 --- a/src/invent.c +++ b/src/invent.c @@ -168,9 +168,7 @@ struct obj **potmp, **pobj; / (otmp->quan + obj->quan); otmp->quan += obj->quan; -#ifdef GOLDOBJ /* temporary special case for gold objects!!!! */ -#endif if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp); else otmp->owt += obj->owt; if(!has_oname(otmp) && has_oname(obj)) @@ -238,11 +236,7 @@ addinv_core1(obj) struct obj *obj; { if (obj->oclass == COIN_CLASS) { -#ifndef GOLDOBJ - u.ugold += obj->quan; -#else context.botl = 1; -#endif } else if (obj->otyp == AMULET_OF_YENDOR) { if (u.uhave.amulet) impossible("already have amulet?"); u.uhave.amulet = 1; @@ -305,11 +299,6 @@ struct obj *obj; obj->was_thrown = 0; /* not meaningful for invent */ addinv_core1(obj); -#ifndef GOLDOBJ - /* if handed gold, we're done */ - if (obj->oclass == COIN_CLASS) - return obj; -#endif /* merge with quiver in preference to any other inventory slot in case quiver and wielded weapon are both eligible; adding @@ -488,10 +477,6 @@ freeinv_core(obj) struct obj *obj; { if (obj->oclass == COIN_CLASS) { -#ifndef GOLDOBJ - u.ugold -= obj->quan; - obj->in_use = FALSE; -#endif context.botl = 1; return; } else if (obj->otyp == AMULET_OF_YENDOR) { @@ -679,60 +664,6 @@ register int x, y; return((struct obj *)0); } -#ifndef GOLDOBJ -/* Make a gold object from the hero's gold. */ -struct obj * -mkgoldobj(q) -register long q; -{ - register struct obj *otmp; - - otmp = mksobj(GOLD_PIECE, FALSE, FALSE); - u.ugold -= q; - otmp->quan = q; - otmp->owt = weight(otmp); - context.botl = 1; - return(otmp); -} - -/* used for container apply/#loot and multi-item Drop */ -struct obj * -insert_gold_into_invent(keep_on_status_line) -boolean keep_on_status_line; -{ - struct obj *u_gold = 0; - - if (u.ugold) { - u_gold = mkgoldobj(u.ugold); - if (keep_on_status_line) { - u_gold->in_use = 1; /* in case of panic/hangup save */ - u.ugold = u_gold->quan; /* put back on status line */ - } /* else mkgoldobj() left status $:0 */ - assigninvlet(u_gold); /* should yield '$' */ - u_gold->where = OBJ_INVENT; - u_gold->nobj = invent; - invent = u_gold; - } - return u_gold; -} - -/* undo insert_gold_into_invent; gold might have been used up though */ -void -remove_gold_from_invent() -{ - struct obj *u_gold = invent; /* we expect gold to be first */ - - if (u_gold && u_gold->otyp != GOLD_PIECE) - u_gold = carrying(GOLD_PIECE); - - if (u_gold) { - extract_nobj(u_gold, &invent); - if (!u_gold->in_use) u.ugold += u_gold->quan; - dealloc_obj(u_gold); - } -} -#endif /* !GOLDOBJ */ - STATIC_OVL void compactify(buf) register char *buf; @@ -802,10 +733,8 @@ const char *action; * struct obj *xxx: object to do something with. * (struct obj *) 0 error return: no object. * &zeroobj explicitly no object (as in w-). -#ifdef GOLDOBJ !!!! test if gold can be used in unusual ways (eaten etc.) !!!! may be able to remove "usegold" -#endif */ struct obj * getobj(let,word) @@ -819,10 +748,6 @@ register const char *let,*word; register char *bp = buf; xchar allowcnt = 0; /* 0, 1 or 2 */ struct obj *firstobj = invent; -#ifndef GOLDOBJ - struct obj *u_gold = 0; - boolean allowgold = FALSE; /* can't use gold because they don't have any */ -#endif boolean usegold = FALSE; /* can't use gold because its illegal */ boolean allowall = FALSE; boolean allownone = FALSE; @@ -833,22 +758,13 @@ register const char *let,*word; long dummymask; if(*let == ALLOW_COUNT) let++, allowcnt = 1; -#ifndef GOLDOBJ - if(*let == COIN_CLASS) let++, - usegold = TRUE, allowgold = (u.ugold ? TRUE : FALSE); -#else if(*let == COIN_CLASS) let++, usegold = TRUE; -#endif /* Equivalent of an "ugly check" for gold */ if (usegold && !strcmp(word, "eat") && (!metallivorous(youmonst.data) || youmonst.data == &mons[PM_RUST_MONSTER])) -#ifndef GOLDOBJ - usegold = allowgold = FALSE; -#else usegold = FALSE; -#endif if(*let == ALL_CLASSES) let++, allowall = TRUE; if(*let == ALLOW_NONE) let++, allownone = TRUE; @@ -866,17 +782,6 @@ register const char *let,*word; useboulder = TRUE; if(allownone) *bp++ = '-'; -#ifndef GOLDOBJ - if(allowgold) { - *bp++ = def_oc_syms[COIN_CLASS].sym; - if (firstobj && firstobj->otyp == GOLD_PIECE) { - /* gold has been inserted into inventory; skip it during - inventory letter collection */ - u_gold = firstobj; - firstobj = u_gold->nobj; - } - } -#endif if(bp > buf && bp[-1] == '-') *bp++ = ' '; ap = altlets; @@ -891,9 +796,7 @@ register const char *let,*word; } if (!*let || index(let, otmp->oclass) -#ifdef GOLDOBJ || (usegold && otmp->invlet == GOLD_SYM) -#endif || (useboulder && otmp->otyp == BOULDER) ) { register int otyp = otmp->otyp; @@ -1010,11 +913,7 @@ register const char *let,*word; compactify(bp); *ap = '\0'; -#ifndef GOLDOBJ - if(!foo && !allowall && !allowgold && !allownone) { -#else if(!foo && !allowall && !allownone) { -#endif You("don't have anything %sto %s.", foox ? "else " : "", word); return((struct obj *)0); @@ -1070,11 +969,6 @@ register const char *let,*word; if (!usegold) { You("cannot %s gold.", word); return(struct obj *)0; -#ifndef GOLDOBJ - } else if (!allowgold) { - You("are not carrying any gold."); - return(struct obj *)0; -#endif } /* Historic note: early Nethack had a bug which was * first reported for Larn, where trying to drop 2^32-n @@ -1089,15 +983,6 @@ register const char *let,*word; return (struct obj *)0; } -#ifndef GOLDOBJ - if(!(allowcnt == 2 && cnt < u.ugold)) - cnt = u.ugold; - if (!u_gold) - u_gold = mkgoldobj(cnt); - else if (cnt < u_gold->quan) - u_gold = splitobj(u_gold, cnt); - return u_gold; -#endif } if(ilet == '?' || ilet == '*') { char *allowed_choices = (ilet == '?') ? lets : (char *)0; @@ -1124,9 +1009,7 @@ register const char *let,*word; /* permit counts for throwing gold, but don't accept * counts for other things since the throw code will * split off a single item anyway */ -#ifdef GOLDOBJ if (ilet != def_oc_syms[COIN_CLASS].sym) -#endif allowcnt = 1; if(cnt == 0 && prezero) return((struct obj *)0); if(cnt > 1) { @@ -1134,9 +1017,7 @@ register const char *let,*word; continue; } } -#ifdef GOLDOBJ context.botl = 1; /* May have changed the amount of money */ -#endif #ifdef REDO savech(ilet); #endif @@ -1159,9 +1040,7 @@ register const char *let,*word; break; } if(!allowall && let && !index(let,otmp->oclass) -#ifdef GOLDOBJ && !(usegold && otmp->oclass == COIN_CLASS) -#endif ) { silly_thing(word, otmp); return((struct obj *)0); @@ -1289,25 +1168,14 @@ unsigned *resultflags; boolean FDECL((*filter),(OBJ_P)) = (boolean FDECL((*),(OBJ_P))) 0; boolean takeoff, ident, allflag, m_seen; int itemcount; -#ifndef GOLDOBJ - int oletct, iletct, allowgold, unpaid, oc_of_sym; -#else int oletct, iletct, unpaid, oc_of_sym; -#endif char sym, *ip, olets[MAXOCLASSES+5], ilets[MAXOCLASSES+5]; char extra_removeables[3+1]; /* uwep,uswapwep,uquiver */ char buf[BUFSZ], qbuf[QBUFSZ]; if (resultflags) *resultflags = 0; -#ifndef GOLDOBJ - allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; -#endif takeoff = ident = allflag = m_seen = FALSE; -#ifndef GOLDOBJ - if(!invent && !allowgold){ -#else if(!invent){ -#endif You("have nothing to %s.", word); return(0); } @@ -1322,9 +1190,6 @@ unsigned *resultflags; iletct = collect_obj_classes(ilets, invent, FALSE, -#ifndef GOLDOBJ - (allowgold != 0), -#endif filter, &itemcount); unpaid = count_unpaid(invent); @@ -1397,15 +1262,7 @@ unsigned *resultflags; } if (oc_of_sym == COIN_CLASS && !combo) { -#ifndef GOLDOBJ - if (allowgold == 1) - (*fn)(mkgoldobj(u.ugold)); - else if (!u.ugold) - You("have no gold."); - allowgold = 2; -#else context.botl = 1; -#endif } else if (sym == 'a') { allflag = TRUE; } else if (sym == 'A') { @@ -1442,16 +1299,10 @@ unsigned *resultflags; return (allflag || (!oletct && ckfn != ckunpaid)) ? -2 : -3; else if (flags.menu_style != MENU_TRADITIONAL && combo && !allflag) return 0; -#ifndef GOLDOBJ - else if (allowgold == 2 && !oletct) - return 1; /* you dropped gold (or at least tried to) */ - else { -#else else /*!!!! if (allowgold == 2 && !oletct) !!!! return 1; you dropped gold (or at least tried to) !!!! test gold dropping else*/ { -#endif int cnt = askchain(&invent, olets, allflag, fn, ckfn, mx, word); /* * askchain() has already finished the job in this case @@ -1728,10 +1579,6 @@ STATIC_OVL char obj_to_let(obj) /* should of course only be called for things in invent */ register struct obj *obj; { -#ifndef GOLDOBJ - if (obj->oclass == COIN_CLASS) - return GOLD_SYM; -#endif if (!flags.invlet_constant) { obj->invlet = NOINVSYM; reassign(); @@ -1787,11 +1634,6 @@ long quan; /* if non-0, print this quantity, not obj->quan */ Sprintf(li, "%c - %-45s %6ld %s", (dot && use_invlet ? obj->invlet : let), (txt ? txt : doname(obj)), cost, currency(cost)); -#ifndef GOLDOBJ - } else if (obj && obj->oclass == COIN_CLASS) { - Sprintf(li, "%ld gold piece%s%s", obj->quan, plur(obj->quan), - (dot ? "." : "")); -#endif } else { /* ordinary inventory display or pickup message */ Sprintf(li, "%c - %s%s", @@ -1885,11 +1727,7 @@ long* out_cnt; to here is short circuited away. */ if (!invent && !(flags.perm_invent && !lets && !want_reply)) { -#ifndef GOLDOBJ - pline("Not carrying anything%s.", u.ugold ? " except gold" : ""); -#else pline("Not carrying anything."); -#endif return 0; } @@ -2219,11 +2057,7 @@ dotypeinv() boolean traditional = TRUE; const char *prompt = "What type of object do you want an inventory of?"; -#ifndef GOLDOBJ - if (!invent && !u.ugold && !billx) { -#else if (!invent && !billx) { -#endif You("aren't carrying anything."); return 0; } @@ -2245,9 +2079,6 @@ dotypeinv() types[0] = 0; class_count = collect_obj_classes(types, invent, FALSE, -#ifndef GOLDOBJ - (u.ugold != 0), -#endif (boolean FDECL((*),(OBJ_P))) 0, &itemcount); if (unpaid_count) { Strcat(types, "u"); @@ -2592,10 +2423,8 @@ mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */ { int objnamelth = 0, otmpnamelth = 0; if (obj->otyp != otmp->otyp) return FALSE; -#ifdef GOLDOBJ /* coins of the same kind will always merge */ if (obj->oclass == COIN_CLASS) return TRUE; -#endif if (obj->unpaid != otmp->unpaid || obj->spe != otmp->spe || obj->dknown != otmp->dknown || (obj->bknown != otmp->bknown && !Role_if(PM_PRIEST)) || @@ -2676,18 +2505,11 @@ doprgold() { /* the messages used to refer to "carrying gold", but that didn't take containers into account */ -#ifndef GOLDOBJ - if(!u.ugold) - Your("wallet is empty."); - else - Your("wallet contains %ld gold piece%s.", u.ugold, plur(u.ugold)); -#else long umoney = money_cnt(invent); if(!umoney) Your("wallet is empty."); else Your("wallet contains %ld %s.", umoney, currency(umoney)); -#endif shopper_financial_report(); return 0; } @@ -2915,17 +2737,13 @@ reassign() register struct obj *obj; for(obj = invent, i = 0; obj; obj = obj->nobj, i++) { -#ifdef GOLDOBJ if (obj->oclass == COIN_CLASS && obj->invlet == GOLD_SYM) --i; /* keep $ instead of using up i'th letter */ else -#endif if (i < 52) obj->invlet = (i < 26) ? ('a'+i) : ('A'+i-26); -#ifdef GOLDOBJ else if (obj->oclass == COIN_CLASS) obj->invlet = GOLD_SYM; -#endif else obj->invlet = NOINVSYM; } @@ -2969,7 +2787,6 @@ doorganize() /* inventory organizer by Del Lamb */ const char *adj_type; if (!invent) { - /* (we don't need any !GOLDOBJ check for "except gold" here) */ You("aren't carrying anything to adjust."); return 0; } @@ -3178,20 +2995,12 @@ int dflags; char *title; { struct obj *ret; -#ifndef GOLDOBJ - struct obj m_gold; -#endif char tmp[QBUFSZ]; int n; menu_item *selected = 0; int do_all = (dflags & MINV_ALL) != 0, incl_hero = (do_all && u.uswallow && mon == u.ustuck), -#ifndef GOLDOBJ - do_gold = (do_all && mon->mgold), - have_inv = (mon->minvent || do_gold), -#else have_inv = (mon->minvent != 0), -#endif have_any = (have_inv || incl_hero); Sprintf(tmp,"%s %s:", s_suffix(noit_Monnam(mon)), @@ -3203,34 +3012,12 @@ char *title; */ youmonst.data = mon->data; -#ifndef GOLDOBJ - if (do_gold) { - /* - * Make temporary gold object and insert at the head of - * the mon's inventory. We can get away with using a - * stack variable object because monsters don't carry - * gold in their inventory, so it won't merge. - */ - m_gold = zeroobj; - m_gold.otyp = GOLD_PIECE; m_gold.oclass = COIN_CLASS; - m_gold.quan = mon->mgold; m_gold.dknown = 1; - m_gold.where = OBJ_FREE; - /* we had better not merge and free this object... */ - if (add_to_minv(mon, &m_gold)) - panic("display_minventory: static object freed."); - } - -#endif n = query_objlist(title ? title : tmp, mon->minvent, INVORDER_SORT | (incl_hero ? INCLUDE_HERO : 0), &selected, (dflags & MINV_NOLET) ? PICK_NONE : PICK_ONE, do_all ? allow_all : worn_wield_only); -#ifndef GOLDOBJ - if (do_gold) obj_extract_self(&m_gold); -#endif - set_uasmon(); } else { invdisp_nothing(title ? title : tmp, "(none)"); @@ -3240,14 +3027,6 @@ char *title; if (n > 0) { ret = selected[0].item.a_obj; free((genericptr_t)selected); -#ifndef GOLDOBJ - /* - * Unfortunately, we can't return a pointer to our temporary - * gold object. We'll have to work out a scheme where this - * can happen. Maybe even put gold in the inventory list... - */ - if (ret == &m_gold) ret = (struct obj *) 0; -#endif } else ret = (struct obj *) 0; return ret; diff --git a/src/makemon.c b/src/makemon.c index 0f2d0c41c..9b63c72ec 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -454,7 +454,6 @@ register struct monst *mtmp; (void) mongets(mtmp, rnd_offensive_item(mtmp)); } -#ifdef GOLDOBJ /* * Makes up money for monster's inventory. * This will change with silver & copper coins @@ -468,7 +467,6 @@ long amount; gold->quan = amount; add_to_minv(mtmp, gold); } -#endif STATIC_OVL void m_initinv(mtmp) @@ -555,11 +553,7 @@ register struct monst *mtmp; rn2(3) ? CLOAK_OF_PROTECTION : CLOAK_OF_MAGIC_RESISTANCE); (void) mongets(mtmp, SMALL_SHIELD); -#ifndef GOLDOBJ - mtmp->mgold = (long)rn1(10,20); -#else mkmonmoney(mtmp,(long)rn1(10,20)); -#endif } else if (quest_mon_represents_role(ptr,PM_MONK)) { (void) mongets(mtmp, rn2(11) ? ROBE : CLOAK_OF_MAGIC_RESISTANCE); @@ -613,11 +607,7 @@ register struct monst *mtmp; } break; case S_LEPRECHAUN: -#ifndef GOLDOBJ - mtmp->mgold = (long) d(level_difficulty(), 30); -#else mkmonmoney(mtmp, (long) d(level_difficulty(), 30)); -#endif break; case S_DEMON: /* moved here from m_initweap() because these don't @@ -640,14 +630,8 @@ register struct monst *mtmp; (void) mongets(mtmp, rnd_defensive_item(mtmp)); if ((int) mtmp->m_lev > rn2(100)) (void) mongets(mtmp, rnd_misc_item(mtmp)); -#ifndef GOLDOBJ - if (likes_gold(ptr) && !mtmp->mgold && !rn2(5)) - mtmp->mgold = - (long) d(level_difficulty(), mtmp->minvent ? 5 : 10); -#else if (likes_gold(ptr) && !findgold(mtmp->minvent) && !rn2(5)) mkmonmoney(mtmp, (long) d(level_difficulty(), mtmp->minvent ? 5 : 10)); -#endif } /* Note: for long worms, always call cutworm (cutworm calls clone_mon) */ @@ -691,9 +675,6 @@ xchar x, y; /* clone's preferred location or 0 (near mon) */ m2->mcloned = 1; m2->minvent = (struct obj *) 0; /* objects don't clone */ m2->mleashed = FALSE; -#ifndef GOLDOBJ - m2->mgold = 0L; -#endif /* Max HP the same, but current HP halved for both. The caller * might want to override this by halving the max HP also. * When current HP is odd, the original keeps the extra point. diff --git a/src/mhitm.c b/src/mhitm.c index a749cfd4d..0e8bf7d1c 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1050,14 +1050,6 @@ mdamagem(magr, mdef, mattk) break; case AD_SGLD: tmp = 0; -#ifndef GOLDOBJ - if (magr->mcan || !mdef->mgold) break; - /* technically incorrect; no check for stealing gold from - * between mdef's feet... - */ - magr->mgold += mdef->mgold; - mdef->mgold = 0; -#else if (magr->mcan) break; /* technically incorrect; no check for stealing gold from * between mdef's feet... @@ -1068,7 +1060,6 @@ mdamagem(magr, mdef, mattk) obj_extract_self(gold); add_to_minv(magr, gold); } -#endif mdef->mstrategy &= ~STRAT_WAITFORU; if (vis) { Strcpy(buf, Monnam(magr)); diff --git a/src/mhitu.c b/src/mhitu.c index ad68b2d31..511513f39 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -2430,27 +2430,6 @@ register struct monst *mon; pline("%s tries to take your money, but fails...", noit_Monnam(mon)); else { -#ifndef GOLDOBJ - long cost; - - if (u.ugold > (long)LARGEST_INT - 10L) - cost = (long) rnd(LARGEST_INT) + 500L; - else - cost = (long) rnd((int)u.ugold + 10) + 500L; - if (mon->mpeaceful) { - cost /= 5L; - if (!cost) cost = 1L; - } - if (cost > u.ugold) cost = u.ugold; - if (!cost) verbalize("It's on the house!"); - else { - pline("%s takes %ld %s for services rendered!", - noit_Monnam(mon), cost, currency(cost)); - u.ugold -= cost; - mon->mgold += cost; - context.botl = 1; - } -#else long cost; long umoney = money_cnt(invent); @@ -2470,7 +2449,6 @@ register struct monst *mon; money2mon(mon, cost); context.botl = 1; } -#endif } if (!rn2(25)) mon->mcan = 1; /* monster is worn out */ if (!tele_restrict(mon)) (void) rloc(mon, FALSE); diff --git a/src/minion.c b/src/minion.c index f70b426b7..814bb21b5 100644 --- a/src/minion.c +++ b/src/minion.c @@ -236,11 +236,7 @@ register struct monst *mtmp; if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); return(1); } -#ifndef GOLDOBJ - cash = u.ugold; -#else cash = money_cnt(invent); -#endif demand = (cash * (rnd(80) + 20 * Athome)) / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); @@ -281,9 +277,7 @@ struct monst *mtmp; { char buf[BUFSZ]; long offer; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#endif getlin("How much will you offer?", buf); if (sscanf(buf, "%ld", &offer) != 1) offer = 0L; @@ -297,16 +291,6 @@ struct monst *mtmp; } else if (offer == 0L) { You("refuse."); return 0L; -#ifndef GOLDOBJ - } else if (offer >= u.ugold) { - You("give %s all your gold.", mon_nam(mtmp)); - offer = u.ugold; - } else { - You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer)); - } - u.ugold -= offer; - mtmp->mgold += offer; -#else } else if (offer >= umoney) { You("give %s all your gold.", mon_nam(mtmp)); offer = umoney; @@ -314,7 +298,6 @@ struct monst *mtmp; You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer)); } (void) money2mon(mtmp, offer); -#endif context.botl = 1; return(offer); } diff --git a/src/mkobj.c b/src/mkobj.c index 253fd1293..47b6668e7 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1037,9 +1037,7 @@ register struct obj *otmp; { int old_light = 0; -#ifdef GOLDOBJ if (otmp->oclass == COIN_CLASS) return; -#endif if (otmp->lamplit) old_light = arti_light_radius(otmp); otmp->cursed = 0; otmp->blessed = 1; @@ -1074,9 +1072,7 @@ register struct obj *otmp; { int old_light = 0; -#ifdef GOLDOBJ if (otmp->oclass == COIN_CLASS) return; -#endif if (otmp->lamplit) old_light = arti_light_radius(otmp); otmp->blessed = 0; otmp->cursed = 1; @@ -1351,10 +1347,6 @@ struct monst *mtmp; mtmp2->data = (struct permonst *)0; mtmp2->minvent = (struct obj *)0; if (mtmp->mextra) copy_mextra(mtmp2, mtmp); -#ifndef GOLDOBJ - /* not a pointer but is discarded along with minvent */ - mtmp2->mgold = 0L; -#endif } return obj; } diff --git a/src/mon.c b/src/mon.c index d65eb1cf9..0de59cf8a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -826,13 +826,8 @@ mpickgold(mtmp) if ((gold = g_at(mtmp->mx, mtmp->my)) != 0) { mat_idx = objects[gold->otyp].oc_material; -#ifndef GOLDOBJ - mtmp->mgold += gold->quan; - delobj(gold); -#else obj_extract_self(gold); add_to_minv(mtmp, gold); -#endif if (cansee(mtmp->mx, mtmp->my) ) { if (flags.verbose && !mtmp->isgd) pline("%s picks up some %s.", Monnam(mtmp), @@ -1731,9 +1726,6 @@ register struct monst *mdef; mdrop_special_objs(mdef); /* release rest of monster's inventory--it is removed from game */ discard_minvent(mdef); -#ifndef GOLDOBJ - mdef->mgold = 0L; -#endif m_detach(mdef, mdef->data); } @@ -1789,16 +1781,6 @@ register struct monst *mdef; oldminvent = obj->nobj; (void) add_to_container(otmp, obj); } -#ifndef GOLDOBJ - if (mdef->mgold) { - struct obj *au; - au = mksobj(GOLD_PIECE, FALSE, FALSE); - au->quan = mdef->mgold; - au->owt = weight(au); - (void) add_to_container(otmp, au); - mdef->mgold = 0; - } -#endif /* Archeologists should not break unique statues */ if (mdef->data->geno & G_UNIQ) otmp->spe = 1; diff --git a/src/monmove.c b/src/monmove.c index 490f7faa0..316018e52 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -477,13 +477,8 @@ toofar: if(!nearby || mtmp->mflee || scared || mtmp->mconf || mtmp->mstun || (mtmp->minvis && !rn2(3)) || -#ifndef GOLDOBJ - (mdat->mlet == S_LEPRECHAUN && - !u.ugold && (mtmp->mgold || rn2(2))) || -#else (mdat->mlet == S_LEPRECHAUN && !findgold(invent) && (findgold(mtmp->minvent) || rn2(2))) || -#endif (is_wanderer(mdat) && !rn2(4)) || (Conflict && !mtmp->iswiz) || (!mtmp->mcansee && !rn2(4)) || mtmp->mpeaceful) { /* Possibly cast an undirected spell if not attacking you */ @@ -765,9 +760,7 @@ not_special: if (mtmp->mconf || (u.uswallow && mtmp == u.ustuck)) appr = 0; else { -#ifdef GOLDOBJ struct obj *lepgold, *ygold; -#endif boolean should_see = (couldsee(omx, omy) && (levl[gx][gy].lit || !levl[omx][omy].lit) && @@ -783,12 +776,8 @@ not_special: appr = 0; if(monsndx(ptr) == PM_LEPRECHAUN && (appr == 1) && -#ifndef GOLDOBJ - (mtmp->mgold > u.ugold)) -#else ( (lepgold = findgold(mtmp->minvent)) && (lepgold->quan > ((ygold = findgold(invent)) ? ygold->quan : 0L)) )) -#endif appr = -1; if (!should_see && can_track(ptr)) { @@ -1320,9 +1309,7 @@ register struct monst *mtmp; { boolean notseen, gotu; register int disp, mx = mtmp->mux, my = mtmp->muy; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#endif /* * do cheapest and/or most likely tests first @@ -1340,13 +1327,7 @@ register struct monst *mtmp; if (notseen || Underwater) { /* Xorns can smell quantities of valuable metal like that in solid gold coins, treat as seen */ - if ((mtmp->data == &mons[PM_XORN]) && -#ifndef GOLDOBJ - u.ugold -#else - umoney -#endif - && !Underwater) + if ((mtmp->data == &mons[PM_XORN]) && umoney && !Underwater) disp = 0; else disp = 1; @@ -1433,22 +1414,14 @@ struct monst *mtmp; struct obj *chain, *obj; if (mtmp == &youmonst) { -#ifndef GOLDOBJ - if (u.ugold > 100L) return TRUE; -#endif chain = invent; } else { -#ifndef GOLDOBJ - if (mtmp->mgold > 100L) return TRUE; -#endif chain = mtmp->minvent; } for (obj = chain; obj; obj = obj->nobj) { int typ = obj->otyp; -#ifdef GOLDOBJ if (typ == COIN_CLASS && obj->quan > 100L) return TRUE; -#endif if (obj->oclass != GEM_CLASS && !(typ >= ARROW && typ <= BOOMERANG) && !(typ >= DAGGER && typ <= CRYSKNIFE) && diff --git a/src/mplayer.c b/src/mplayer.c index c2b7f23f8..e1cc0f812 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -260,11 +260,7 @@ register boolean special; (void)mongets(mtmp, rnd_class(DILITHIUM_CRYSTAL, JADE)); /* To get the gold "right" would mean a player can double his */ /* gold supply by killing one mplayer. Not good. */ -#ifndef GOLDOBJ - mtmp->mgold = rn2(1000); -#else mkmonmoney(mtmp, rn2(1000)); -#endif quan = rn2(10); while(quan--) (void) mpickobj(mtmp, mkobj(RANDOM_CLASS, FALSE)); diff --git a/src/objnam.c b/src/objnam.c index 824398123..321d7ff29 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -930,10 +930,8 @@ boolean not_fully_identified(otmp) register struct obj *otmp; { -#ifdef GOLDOBJ /* gold doesn't have any interesting attributes [yet?] */ if (otmp->oclass == COIN_CLASS) return FALSE; /* always fully ID'd */ -#endif /* check fundamental ID hallmarks first */ if (!otmp->known || !otmp->dknown || #ifdef MAIL @@ -2592,15 +2590,9 @@ struct obj *no_wish; !strcmpi(bp, "coin") || *bp == GOLD_SYM) { if (cnt > 5000 && !wizard) cnt = 5000; else if (cnt < 1) cnt = 1; -#ifndef GOLDOBJ - pline("%d gold piece%s.", cnt, plur(cnt)); - u.ugold += (long) cnt; - otmp = &zeroobj; /* readobjnam()'s return value for gold */ -#else otmp = mksobj(GOLD_PIECE, FALSE, FALSE); otmp->quan = (long) cnt; otmp->owt = weight(otmp); -#endif context.botl = 1; return otmp; } diff --git a/src/options.c b/src/options.c index 9083ae63e..dc8cbcfc2 100644 --- a/src/options.c +++ b/src/options.c @@ -909,12 +909,7 @@ char *op; char *sp, buf[BUFSZ]; num = 0; -#ifndef GOLDOBJ - if (!index(op, GOLD_SYM)) - buf[num++] = COIN_CLASS; -#else /* !!!! probably unnecessary with gold as normal inventory */ -#endif for (sp = op; *sp; sp++) { oc_sym = def_char_to_objclass(*sp); diff --git a/src/pickup.c b/src/pickup.c index bbc9a925d..30188e5f2 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -12,13 +12,8 @@ #define CONTAINED_SYM '>' /* from invent.c */ STATIC_DCL void FDECL(simple_look, (struct obj *,BOOLEAN_P)); -#ifndef GOLDOBJ -STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *, - const char *,struct obj *,BOOLEAN_P,BOOLEAN_P,int *)); -#else STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *, const char *,struct obj *,BOOLEAN_P,int *)); -#endif STATIC_DCL boolean FDECL(fatal_corpse_mistake, (struct obj *,BOOLEAN_P)); STATIC_DCL void FDECL(check_here, (BOOLEAN_P)); STATIC_DCL boolean FDECL(n_or_more, (struct obj *)); @@ -101,15 +96,6 @@ boolean here; /* flag for type of obj list linkage */ } } -#ifndef GOLDOBJ -int -collect_obj_classes(ilets, otmp, here, incl_gold, filter, itemcount) -char ilets[]; -register struct obj *otmp; -boolean here, incl_gold; -boolean FDECL((*filter),(OBJ_P)); -int *itemcount; -#else int collect_obj_classes(ilets, otmp, here, filter, itemcount) char ilets[]; @@ -117,16 +103,11 @@ register struct obj *otmp; boolean here; boolean FDECL((*filter),(OBJ_P)); int *itemcount; -#endif { register int iletct = 0; register char c; *itemcount = 0; -#ifndef GOLDOBJ - if (incl_gold) - ilets[iletct++] = def_oc_syms[COIN_CLASS].sym; -#endif ilets[iletct] = '\0'; /* terminate ilets so that index() will work */ while (otmp) { c = def_oc_syms[(int)otmp->oclass].sym; @@ -151,17 +132,6 @@ int *itemcount; * "?/a" or "a?/" or "/a?",&c picks all '?' even though no '/' * (ie, treated as if it had just been "?a"). */ -#ifndef GOLDOBJ -STATIC_OVL boolean -query_classes(oclasses, one_at_a_time, everything, action, objs, - here, incl_gold, menu_on_demand) -char oclasses[]; -boolean *one_at_a_time, *everything; -const char *action; -struct obj *objs; -boolean here, incl_gold; -int *menu_on_demand; -#else STATIC_OVL boolean query_classes(oclasses, one_at_a_time, everything, action, objs, here, menu_on_demand) @@ -171,7 +141,6 @@ const char *action; struct obj *objs; boolean here; int *menu_on_demand; -#endif { char ilets[20], inbuf[BUFSZ]; int iletct, oclassct; @@ -183,9 +152,6 @@ int *menu_on_demand; oclasses[oclassct = 0] = '\0'; *one_at_a_time = *everything = m_seen = FALSE; iletct = collect_obj_classes(ilets, objs, here, -#ifndef GOLDOBJ - incl_gold, -#endif (boolean FDECL((*),(OBJ_P))) 0, &itemcount); if (iletct == 0) { return FALSE; @@ -578,9 +544,6 @@ menu_pickup: if (!query_classes(oclasses, &selective, &all_of_a_type, "pick up", objchain, traverse_how == BY_NEXTHERE, -#ifndef GOLDOBJ - FALSE, -#endif &via_menu)) { if (!via_menu) return (0); n = query_objlist("Pick up what?", @@ -1096,11 +1059,7 @@ int *wt_before, *wt_after; savequan = obj->quan; saveowt = obj->owt; -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif iw = max_capacity(); if (count != savequan) { @@ -1324,53 +1283,6 @@ boolean telekinesis; /* not picking it up directly by hand */ return 0; } else if (obj->oartifact && !touch_artifact(obj,&youmonst)) { return 0; -#ifndef GOLDOBJ - } else if (obj->oclass == COIN_CLASS) { - /* Special consideration for gold pieces... */ - long iw = (long)max_capacity() - GOLD_WT(u.ugold); - long gold_capacity = GOLD_CAPACITY(iw, u.ugold); - const char *where = (obj->ox == u.ux && obj->oy == u.uy) ? - "here" : "there"; - - if (gold_capacity <= 0L) { - pline( - "There %s %ld gold piece%s %s, but you cannot carry any more.", - otense(obj, "are"), - obj->quan, plur(obj->quan), where); - return 0; - } else if (gold_capacity < count) { - You("can only %s %s of the %ld gold pieces lying %s.", - telekinesis ? "acquire" : "carry", - gold_capacity == 1L ? "one" : "some", obj->quan, where); - pline("%s %ld gold piece%s.", - nearloadmsg, gold_capacity, plur(gold_capacity)); - u.ugold += gold_capacity; - obj->quan -= gold_capacity; - costly_gold(obj->ox, obj->oy, gold_capacity); - } else { - u.ugold += count; - if (count == obj->quan) - /* costly_gold() can trigger --More-- prompt, so - take gold off map before messages in order to - prevent hangup save there from duplicating it */ - obj_extract_self(obj); /* remove from floor */ - else - obj->quan -= count; - if ((nearload = near_capacity()) != 0) - pline("%s %ld gold piece%s.", - nearload < MOD_ENCUMBER ? - moderateloadmsg : nearloadmsg, - count, plur(count)); - else - prinv((char *) 0, obj, count); - costly_gold(obj->ox, obj->oy, count); - if (obj->where == OBJ_FREE) - delobj(obj); - } - context.botl = 1; - if (context.run) nomul(0); - return 1; -#endif } else if (obj->otyp == CORPSE) { if (fatal_corpse_mistake(obj, telekinesis) || rider_corpse_revival(obj, telekinesis)) @@ -1395,10 +1307,8 @@ boolean telekinesis; /* not picking it up directly by hand */ if ((res = lift_object(obj, (struct obj *)0, &count, telekinesis)) <= 0) return res; -#ifdef GOLDOBJ /* Whats left of the special case for gold :-) */ if (obj->oclass == COIN_CLASS) context.botl = 1; -#endif if (obj->quan != count && obj->otyp != LOADSTONE) obj = splitobj(obj, count); @@ -1417,8 +1327,6 @@ boolean telekinesis; /* not picking it up directly by hand */ * and putting it in the hero's inventory. Take care of billing. Return a * pointer to the object where otmp ends up. This may be different * from otmp because of merging. - * - * Gold never reaches this routine unless GOLDOBJ is defined. */ struct obj * pick_obj(otmp) @@ -1703,12 +1611,6 @@ reverse_loot() return FALSE; } -#ifndef GOLDOBJ - if (u.ugold) { - contribution = ((long)rnd(5) * u.ugold + 4L) / 5L; - goldob = mkgoldobj(contribution); - } -#else /* find a money object to mess with */ for (goldob = invent; goldob; goldob = goldob->nobj) if (goldob->oclass == COIN_CLASS) { @@ -1717,7 +1619,6 @@ reverse_loot() goldob = splitobj(goldob, contribution); break; } -#endif if (!goldob) return FALSE; if (!IS_THRONE(levl[x][y].typ)) { @@ -1738,9 +1639,7 @@ reverse_loot() if (coffers) { verbalize("Thank you for your contribution to reduce the debt."); -#ifdef GOLDOBJ freeinv(goldob); -#endif (void)add_to_container(coffers, goldob); coffers->owt = weight(coffers); coffers->cknown = 0; @@ -1749,13 +1648,8 @@ reverse_loot() (void)boxlock(coffers, &boxdummy); } } else if ((mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) { -#ifndef GOLDOBJ - mon->mgold += goldob->quan; - delobj(goldob); -#else freeinv(goldob); add_to_minv(mon, goldob); -#endif pline("The exchequer accepts your contribution."); } else { You("drop %s.", doname(goldob)); @@ -2048,9 +1942,6 @@ register struct obj *obj; otmp, count); if (is_gold) { -#ifndef GOLDOBJ - dealloc_obj(obj); -#endif bot(); /* update character's gold piece count immediately */ } return 1; @@ -2167,9 +2058,6 @@ struct obj **objp; int held; { struct obj *curr, *otmp, *obj = *objp; -#ifndef GOLDOBJ - struct obj *u_gold = (struct obj *)0; -#endif boolean quantum_cat, cursed_mbag, loot_out, loot_in, loot_in_first, stash_one, inokay, outokay, outmaybe; @@ -2233,9 +2121,6 @@ int held; } inokay = (invent != 0 && !(invent == current_container && !current_container->nobj)); -#ifndef GOLDOBJ - if (u.ugold) inokay = TRUE; -#endif outokay = Has_contents(current_container); if (!outokay) /* preformat the empty-container message */ Sprintf(emptymsg, "%s is %sempty.", @@ -2330,11 +2215,6 @@ int held; } } -#ifndef GOLDOBJ - /* if putting in, place gold where inventory traversal will see it */ - if ((loot_in || stash_one) && u.ugold) - u_gold = insert_gold_into_invent(TRUE); -#endif if ((loot_in || stash_one) && (!invent || (invent == current_container && !invent->nobj))) { You("don't have anything%s to %s.", @@ -2370,11 +2250,6 @@ int held; /* putting something in might have triggered magic bag explosion */ if (!current_container) loot_out = FALSE; -#ifndef GOLDOBJ - /* if we put gold into inventory above, take it back out now */ - if (u_gold) remove_gold_from_invent(); -#endif - /* out after in */ if (loot_out && loot_in_first) { if (!Has_contents(current_container)) { @@ -2432,9 +2307,6 @@ boolean put_in; if (query_classes(selection, &one_by_one, &allflag, action, *objlist, FALSE, -#ifndef GOLDOBJ - put_in ? (boolean)(u.ugold != 0L) : FALSE, -#endif &menu_on_request)) { if (askchain(objlist, (one_by_one ? (char *)0 : selection), allflag, actionfunc, checkfunc, 0, action)) diff --git a/src/priest.c b/src/priest.c index 5e3b2ea10..1ef7ea286 100644 --- a/src/priest.c +++ b/src/priest.c @@ -539,20 +539,6 @@ register struct monst *priest; priest->mpeaceful = 0; return; } -#ifndef GOLDOBJ - if(!u.ugold) { - if(coaligned && !strayed) { - if (priest->mgold > 0L) { - /* Note: two bits is actually 25 cents. Hmm. */ - pline("%s gives you %s for an ale.", Monnam(priest), - (priest->mgold == 1L) ? "one bit" : "two bits"); - if (priest->mgold > 1L) - u.ugold = 2L; - else - u.ugold = 1L; - priest->mgold -= u.ugold; - context.botl = 1; -#else if(!money_cnt(invent)) { if(coaligned && !strayed) { long pmoney = money_cnt(priest->minvent); @@ -561,7 +547,6 @@ register struct monst *priest; pline("%s gives you %s for an ale.", Monnam(priest), (pmoney == 1L) ? "one bit" : "two bits"); money2u(priest, pmoney > 1L ? 2 : 1); -#endif } else pline("%s preaches the virtues of poverty.", Monnam(priest)); exercise(A_WIS, TRUE); @@ -577,11 +562,7 @@ register struct monst *priest; verbalize("Thou shalt regret thine action!"); if(coaligned) adjalign(-1); } else if(offer < (u.ulevel * 200)) { -#ifndef GOLDOBJ - if(u.ugold > (offer * 2L)) verbalize("Cheapskate."); -#else if(money_cnt(invent) > (offer * 2L)) verbalize("Cheapskate."); -#endif else { verbalize("I thank thee for thy contribution."); /* give player some token */ @@ -589,11 +570,7 @@ register struct monst *priest; } } else if(offer < (u.ulevel * 400)) { verbalize("Thou art indeed a pious individual."); -#ifndef GOLDOBJ - if(u.ugold < (offer * 2L)) { -#else if(money_cnt(invent) < (offer * 2L)) { -#endif if (coaligned && u.ualign.record <= ALGN_SINNED) adjalign(1); verbalize("I bestow upon thee a blessing."); @@ -614,11 +591,7 @@ register struct monst *priest; } else u.ublessed++; } else { verbalize("Thy selfless generosity is deeply appreciated."); -#ifndef GOLDOBJ - if(u.ugold < (offer * 2L) && coaligned) { -#else if(money_cnt(invent) < (offer * 2L) && coaligned) { -#endif if(strayed && (moves - u.ucleansed) > 5000L) { u.ualign.record = 0; /* cleanse thee */ u.ucleansed = moves; diff --git a/src/read.c b/src/read.c index b60ffa66e..9be9f9390 100644 --- a/src/read.c +++ b/src/read.c @@ -992,10 +992,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ } else { for (obj = invent; obj; obj = obj->nobj) { long wornmask; -#ifdef GOLDOBJ /* gold isn't subject to cursing and blessing */ if (obj->oclass == COIN_CLASS) continue; -#endif wornmask = (obj->owornmask & ~(W_BALL|W_ART|W_ARTI)); if (wornmask && !sblessed) { /* handle a couple of special cases; we don't diff --git a/src/restore.c b/src/restore.c index e888b4dcd..b4d4bb7fb 100644 --- a/src/restore.c +++ b/src/restore.c @@ -146,17 +146,6 @@ boolean quietly; for (otmp = invent; otmp; otmp = otmp2) { otmp2 = otmp->nobj; -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) { - /* in_use gold is created by some menu operations */ - if (!otmp->in_use) { - impossible("inven_inuse: !in_use gold in inventory"); - } - extract_nobj(otmp, &invent); - otmp->in_use = FALSE; - dealloc_obj(otmp); - } else -#endif /* GOLDOBJ */ if (otmp->in_use) { if (!quietly) pline("Finishing off %s...", xname(otmp)); useup(otmp); @@ -441,9 +430,6 @@ boolean ghostly; /* restore monster back pointer */ for (obj = mtmp->minvent; obj; obj = obj->nobj) obj->ocarry = mtmp; -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - put_gold_back(mtmp); -#endif } if (mtmp->mw) { struct obj *obj; @@ -598,9 +584,6 @@ unsigned int *stuckid, *steedid; restore_timers(fd, RANGE_GLOBAL, FALSE, 0L); restore_light_sources(fd); invent = restobjchn(fd, FALSE, FALSE); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - put_gold_back(&youmonst); -#endif /* tmp_bc only gets set here if the ball & chain were orphaned because you were swallowed; otherwise they will be on the floor or in your inventory */ @@ -1571,29 +1554,4 @@ register unsigned int len; } } -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ -/* used to make save & bones files be compatible with GOLDOBJ config; - takes all of the gold objects out of the invent or mtmp->minvent - chain and puts it into either u.ugold or mtmp->mgold */ -void -put_gold_back(mon) -struct monst *mon; -{ - struct obj *goldobj; - boolean is_hero = (mon == &youmonst); - - /* there could be two gold objects in invent if a hangup save was - performed while gold was in invent for Drop or container access */ - while ((goldobj = (is_hero ? carrying(GOLD_PIECE) : - m_carrying(mon, GOLD_PIECE))) != 0) { - extract_nobj(goldobj, is_hero ? &invent : &mon->minvent); - if (!goldobj->in_use) { - if (is_hero) u.ugold += goldobj->quan; - else mon->mgold += goldobj->quan; - } - dealloc_obj(goldobj); - } -} -#endif /*GOLDOBJ*/ - /*restore.c*/ diff --git a/src/rip.c b/src/rip.c index 526c56388..8b3d849a3 100644 --- a/src/rip.c +++ b/src/rip.c @@ -107,11 +107,7 @@ time_t when; center(NAME_LINE, buf); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(buf, "%ld Au", u.ugold); -#else Sprintf(buf, "%ld Au", done_money); -#endif buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ center(GOLD_LINE, buf); diff --git a/src/rumors.c b/src/rumors.c index 7df89e8f4..081b81d8d 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -427,11 +427,7 @@ register struct monst *oracl; char qbuf[QBUFSZ]; multi = 0; -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (!oracl) { There("is no one here to consult."); @@ -468,12 +464,7 @@ register struct monst *oracl; u_pay = (umoney < (long)major_cost) ? (int)umoney : major_cost; break; } -#ifndef GOLDOBJ - u.ugold -= (long)u_pay; - oracl->mgold += (long)u_pay; -#else money2mon(oracl, (long)u_pay); -#endif context.botl = 1; add_xpts = 0; /* first oracle of each type gives experience points */ if (u_pay == minor_cost) { diff --git a/src/save.c b/src/save.c index dc0f94078..88db771e2 100644 --- a/src/save.c +++ b/src/save.c @@ -306,9 +306,6 @@ register int fd, mode; bwrite(fd, (genericptr_t) &flags, sizeof(struct flag)); #ifdef SYSFLAGS bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); -#endif -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (u.ugold) (void)insert_gold_into_invent(FALSE); #endif bwrite(fd, (genericptr_t) &u, sizeof(struct you)); bwrite(fd, yyyymmddhhmmss(ubirthday), 14); @@ -319,9 +316,6 @@ register int fd, mode; save_light_sources(fd, mode, RANGE_GLOBAL); saveobjchn(fd, invent, mode); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (!release_data(mode)) remove_gold_from_invent(); -#endif if (BALL_IN_MON) { /* prevent loss of ball & chain when swallowed */ uball->nobj = uchain; @@ -1123,22 +1117,10 @@ register struct monst *mtmp; if (perform_bwrite(mode)) { mtmp->mnum = monsndx(mtmp->data); if (mtmp->ispriest) forget_temple_entry(mtmp); /* EPRI() */ -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (mtmp->mgold) { - struct obj *goldobj = mksobj(GOLD_PIECE, FALSE, FALSE); - - goldobj->quan = mtmp->mgold; - mtmp->mgold = 0L; - add_to_minv(mtmp, goldobj); - } -#endif savemon(fd, mtmp); } if (mtmp->minvent) saveobjchn(fd,mtmp->minvent,mode); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (!release_data(mode)) put_gold_back(mtmp); -#endif if (release_data(mode)) dealloc_monst(mtmp); mtmp = mtmp2; diff --git a/src/shk.c b/src/shk.c index 5a397abf5..0fe0e94db 100644 --- a/src/shk.c +++ b/src/shk.c @@ -78,7 +78,6 @@ STATIC_DCL const char *FDECL(cad, (BOOLEAN_P)); */ -#ifdef GOLDOBJ /* Transfer money from inventory to monster when paying shopkeepers, priests, oracle, succubus, & other demons. @@ -153,8 +152,6 @@ long amount; } } -#endif /* GOLDOBJ */ - STATIC_OVL struct monst * next_shkp(shkp, withbill) register struct monst *shkp; @@ -903,13 +900,8 @@ register struct monst *shkp; long robbed = ESHK(shkp)->robbed; long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp)); -#ifndef GOLDOBJ - u.ugold -= balance; - shkp->mgold += balance; -#else if (balance > 0) money2mon(shkp, balance); else if (balance < 0) money2u(shkp, -balance); -#endif context.botl = 1; if(robbed) { robbed -= tmp; @@ -1235,11 +1227,7 @@ proceed: } if(shkp != resident && NOTANGRY(shkp)) { -#ifdef GOLDOBJ umoney = money_cnt(invent); -#else - umoney = u.ugold; -#endif if(!ltmp) You("do not owe %s anything.", mon_nam(shkp)); else if(!umoney) { @@ -1268,11 +1256,7 @@ proceed: /* ltmp is still eshkp->robbed here */ if (!eshkp->billct && !eshkp->debit) { -#ifdef GOLDOBJ umoney = money_cnt(invent); -#else - umoney = u.ugold; -#endif if(!ltmp && NOTANGRY(shkp)) { You("do not owe %s anything.", shkname(shkp)); if (!umoney) @@ -1325,9 +1309,7 @@ proceed: long dtmp = eshkp->debit; long loan = eshkp->loan; char sbuf[BUFSZ]; -#ifdef GOLDOBJ umoney = money_cnt(invent); -#endif Sprintf(sbuf, "You owe %s %ld %s ", shkname(shkp), dtmp, currency(dtmp)); if(loan) { @@ -1337,11 +1319,7 @@ proceed: "for gold picked up and the use of merchandise."); } else Strcat(sbuf, "for the use of merchandise."); pline1(sbuf); -#ifndef GOLDOBJ - if (u.ugold + eshkp->credit < dtmp) { -#else if (umoney + eshkp->credit < dtmp) { -#endif pline("But you don't%s have enough gold%s.", stashed_gold ? " seem to" : "", eshkp->credit ? " or credit" : ""); @@ -1353,12 +1331,7 @@ proceed: eshkp->loan = 0L; Your("debt is covered by your credit."); } else if (!eshkp->credit) { -#ifndef GOLDOBJ - u.ugold -= dtmp; - shkp->mgold += dtmp; -#else money2mon(shkp, dtmp); -#endif eshkp->debit = 0L; eshkp->loan = 0L; You("pay that debt."); @@ -1366,12 +1339,7 @@ proceed: } else { dtmp -= eshkp->credit; eshkp->credit = 0L; -#ifndef GOLDOBJ - u.ugold -= dtmp; - shkp->mgold += dtmp; -#else money2mon(shkp, dtmp); -#endif eshkp->debit = 0L; eshkp->loan = 0L; pline("That debt is partially offset by your credit."); @@ -1384,22 +1352,14 @@ proceed: /* now check items on bill */ if (eshkp->billct) { register boolean itemize; -#ifndef GOLDOBJ - if (!u.ugold && !eshkp->credit) { -#else umoney = money_cnt(invent); if (!umoney && !eshkp->credit) { -#endif You("%shave no money or credit%s.", stashed_gold ? "seem to " : "", paid ? " left" : ""); return(0); } -#ifndef GOLDOBJ - if ((u.ugold + eshkp->credit) < cheapest_item(shkp)) { -#else if ((umoney + eshkp->credit) < cheapest_item(shkp)) { -#endif You("don't have enough money to buy%s the item%s you picked.", eshkp->billct > 1 ? " any of" : "", plur(eshkp->billct)); if(stashed_gold) @@ -1483,11 +1443,7 @@ boolean itemize; { register struct obj *obj = *obj_p; long ltmp, quan, save_quan; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#else - long umoney = u.ugold; -#endif int buy; boolean stashed_gold = (hidden_gold() > 0L), consumed = (which == 0); @@ -1672,9 +1628,7 @@ int numsk; int croaked; { long loss = 0L; -#ifdef GOLDOBJ long umoney; -#endif struct eshk *eshkp = ESHK(shkp); boolean take = FALSE, taken = FALSE; unsigned save_minvis = shkp->minvis; @@ -1721,12 +1675,8 @@ int croaked; } if (eshkp->following || ANGRY(shkp) || take) { -#ifndef GOLDOBJ - if (!invent && !u.ugold) goto skip; -#else if (!invent) goto skip; umoney = money_cnt(invent); -#endif takes[0] = '\0'; if (!shkp->mcanmove || shkp->msleeping) Strcat(takes, "wakes up and "); @@ -1734,18 +1684,10 @@ int croaked; Strcat(takes, "comes and "); Strcat(takes, "takes"); -#ifndef GOLDOBJ - if (loss > u.ugold || !loss || roomno == eshkp->shoproom) { - eshkp->robbed -= u.ugold; - if (eshkp->robbed < 0L) eshkp->robbed = 0L; - shkp->mgold += u.ugold; - u.ugold = 0L; -#else if (loss > umoney || !loss || roomno == eshkp->shoproom) { eshkp->robbed -= umoney; if (eshkp->robbed < 0L) eshkp->robbed = 0L; if (umoney > 0) money2mon(shkp, umoney); -#endif context.botl = 1; pline("%s %s all your possessions.", shkname(shkp), takes); @@ -1753,12 +1695,7 @@ int croaked; /* where to put player's invent (after disclosure) */ set_repo_loc(shkp); } else { -#ifndef GOLDOBJ - shkp->mgold += loss; - u.ugold -= loss; -#else money2mon(shkp, loss); -#endif context.botl = 1; pline("%s %s the %ld %s %sowed %s.", Monnam(shkp), takes, @@ -1827,14 +1764,9 @@ finish_paybill() unleash_all(); /* if hero has any gold left, take it into shopkeeper's possession */ if (shkp) { -#ifdef GOLDOBJ long umoney = money_cnt(invent); if (umoney) money2mon(shkp, umoney); -#else - shkp->mgold += u.ugold; - u.ugold = 0L; -#endif } /* transfer rest of the character's inventory to the shop floor */ drop_upon_death((struct monst *)0, (struct obj *)0, ox, oy); @@ -2837,11 +2769,7 @@ xchar x, y; return; } -#ifndef GOLDOBJ - shkmoney = shkp->mgold; -#else shkmoney = money_cnt(shkp->minvent); -#endif if (!shkmoney) { char c, qbuf[BUFSZ]; long tmpcr = ((offer * 9L) / 10L) + (offer <= 1L); @@ -3779,11 +3707,7 @@ boolean cant_mollify; } if((um_dist(x, y, 1) && !uinshp) || cant_mollify || -#ifndef GOLDOBJ - (u.ugold + ESHK(shkp)->credit) < cost_of_damage -#else (money_cnt(invent) + ESHK(shkp)->credit) < cost_of_damage -#endif || !rn2(50)) { getcad: if (muteshk(shkp)) { @@ -3807,12 +3731,7 @@ boolean cant_mollify; currency(cost_of_damage), !animal ? "\"" : ""); if(yn(qbuf) != 'n') { cost_of_damage = check_credit(cost_of_damage, shkp); -#ifndef GOLDOBJ - u.ugold -= cost_of_damage; - shkp->mgold += cost_of_damage; -#else money2mon(shkp, cost_of_damage); -#endif context.botl = 1; pline("Mollified, %s accepts your restitution.", shkname(shkp)); @@ -3967,9 +3886,7 @@ shk_chat(shkp) struct monst *shkp; { struct eshk *eshk; -#ifdef GOLDOBJ long shkmoney; -#endif if (!shkp->isshk) { /* The monster type is shopkeeper, but this monster is not actually a shk, which could happen if someone @@ -4010,17 +3927,9 @@ struct monst *shkp; shkname(shkp), eshk->credit, currency(eshk->credit)); else if (eshk->robbed) pline("%s complains about a recent robbery.", shkname(shkp)); -#ifndef GOLDOBJ - else if (shkp->mgold < 50) -#else else if ((shkmoney = money_cnt(shkp->minvent)) < 50) -#endif pline("%s complains that business is bad.", shkname(shkp)); -#ifndef GOLDOBJ - else if (shkp->mgold > 4000) -#else else if (shkmoney > 4000) -#endif pline("%s says that business is good.", shkname(shkp)); else if (is_izchak(shkp, FALSE)) pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))],shkname(shkp)); diff --git a/src/shknam.c b/src/shknam.c index 77bdf2f3c..645fc6b58 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -552,11 +552,7 @@ struct mkroom *sroom; eshkp->billct = eshkp->visitct = 0; eshkp->bill_p = (struct bill_x *)0; eshkp->customer[0] = '\0'; -#ifndef GOLDOBJ - shk->mgold = 1000L + 30L*(long)rnd(100); /* initial capital */ -#else mkmonmoney(shk, 1000L + 30L*(long)rnd(100)); /* initial capital */ -#endif if (shp->shknms == shkrings) (void) mongets(shk, TOUCHSTONE); nameshk(shk, shp->shknms); diff --git a/src/sit.c b/src/sit.c index 72c94c56b..aa3a16605 100644 --- a/src/sit.c +++ b/src/sit.c @@ -9,15 +9,6 @@ void take_gold() { -#ifndef GOLDOBJ - if (u.ugold <= 0) { - You_feel("a strange sensation."); - } else { - You("notice you have no gold!"); - u.ugold = 0; - context.botl = 1; - } -#else struct obj *otmp, *nobj; int lost_money = 0; for (otmp = invent; otmp; otmp = nobj) { @@ -33,7 +24,6 @@ take_gold() You("notice you have no money!"); context.botl = 1; } -#endif } int @@ -324,10 +314,8 @@ rndcurse() /* curse a few inventory items at random! */ } for (otmp = invent; otmp; otmp = otmp->nobj) { -#ifdef GOLDOBJ /* gold isn't subject to being cursed or blessed */ if (otmp->oclass == COIN_CLASS) continue; -#endif nobj++; } if (nobj) { @@ -335,10 +323,8 @@ rndcurse() /* curse a few inventory items at random! */ cnt > 0; cnt--) { onum = rnd(nobj); for (otmp = invent; otmp; otmp = otmp->nobj) { -#ifdef GOLDOBJ /* as above */ if (otmp->oclass == COIN_CLASS) continue; -#endif if (--onum == 0) break; /* found the target */ } /* the !otmp case should never happen; picking an already diff --git a/src/sounds.c b/src/sounds.c index 2a7df5823..593c3ecd6 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -874,11 +874,7 @@ register struct monst *mtmp; else verbl_msg = "Relax, this won't hurt a bit."; break; case MS_GUARD: -#ifndef GOLDOBJ - if (u.ugold) -#else if (money_cnt(invent)) -#endif verbl_msg = "Please drop that gold and follow me."; else verbl_msg = "Please follow me."; diff --git a/src/steal.c b/src/steal.c index f98cd693e..0812a79df 100644 --- a/src/steal.c +++ b/src/steal.c @@ -22,66 +22,6 @@ register struct obj *otmp; "armor"); } -#ifndef GOLDOBJ -long /* actually returns something that fits in an int */ -somegold() -{ -#ifdef LINT /* long conv. ok */ - return(0L); -#else - return (long)( (u.ugold < 100) ? u.ugold : - (u.ugold > 10000) ? rnd(10000) : rnd((int) u.ugold) ); -#endif -} - -void -stealgold(mtmp) -register struct monst *mtmp; -{ - register struct obj *gold = g_at(u.ux, u.uy); - register long tmp; - struct monst *who; - const char *whose, *what; - - if (gold && (!u.ugold || gold->quan > u.ugold || !rn2(5))) { - mtmp->mgold += gold->quan; - delobj(gold); - newsym(u.ux, u.uy); - if (u.usteed) { - who = u.usteed; - whose = s_suffix(y_monnam(who)); - what = makeplural(mbodypart(who, FOOT)); - } else { - who = &youmonst; - whose = "your"; - what = makeplural(body_part(FOOT)); - } - /* [ avoid "between your rear regions" :-] */ - if (slithy(who->data)) what = "coils"; - /* reduce "rear hooves/claws" to "hooves/claws" */ - if (!strncmp(what, "rear ", 5)) what += 5; - pline("%s quickly snatches some gold from %s %s %s!", - Monnam(mtmp), - (Levitation || Flying) ? "beneath" : "between", - whose, what); - if(!u.ugold || !rn2(5)) { - if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); - /* do not set mtmp->mavenge here; gold on the floor is fair game */ - monflee(mtmp, 0, FALSE, FALSE); - } - } else if(u.ugold) { - u.ugold -= (tmp = somegold()); - Your("purse feels lighter."); - mtmp->mgold += tmp; - if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); - mtmp->mavenge = 1; - monflee(mtmp, 0, FALSE, FALSE); - context.botl = 1; - } -} - -#else /* !GOLDOBJ */ - long /* actually returns something that fits in an int */ somegold(umoney) long umoney; @@ -167,7 +107,6 @@ register struct monst *mtmp; context.botl = 1; } } -#endif /* GOLDOBJ */ /* steal armor after you finish taking it off */ unsigned int stealoid; /* object to be stolen */ @@ -257,7 +196,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */ /* Returns 1 when something was stolen (or at least, when N should flee now) * Returns -1 if the monster died in the attempt * Avoid stealing the object stealoid - * GOLDOBJ: nymphs and monkeys won't steal coins + * Nymphs and monkeys won't steal coins */ int steal(mtmp, objnambuf) @@ -304,9 +243,7 @@ nothing_to_steal: tmp = 0; for(otmp = invent; otmp; otmp = otmp->nobj) if ((!uarm || otmp != uarmc) && otmp != uskin -#ifdef GOLDOBJ && otmp->oclass != COIN_CLASS -#endif #ifdef INVISIBLE_OBJECTS && (!otmp->oinvis || perceives(mtmp->data)) #endif @@ -317,9 +254,7 @@ nothing_to_steal: tmp = rn2(tmp); for(otmp = invent; otmp; otmp = otmp->nobj) if ((!uarm || otmp != uarmc) && otmp != uskin -#ifdef GOLDOBJ && otmp->oclass != COIN_CLASS -#endif #ifdef INVISIBLE_OBJECTS && (!otmp->oinvis || perceives(mtmp->data)) #endif @@ -494,13 +429,6 @@ register struct obj *otmp; or kicking code shouldn't continue to track and place it */ if (otmp == thrownobj) thrownobj = 0; else if (otmp == kickedobj) kickedobj = 0; -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) { - mtmp->mgold += otmp->quan; - obfree(otmp, (struct obj *)0); - freed_otmp = 1; - } else { -#endif boolean snuff_otmp = FALSE; /* don't want hidden light source inside the monster; assumes that engulfers won't have external inventories; whirly monsters cause @@ -523,9 +451,6 @@ register struct obj *otmp; freed_otmp = add_to_minv(mtmp, otmp); /* and we had to defer this until object is in mtmp's inventory */ if (snuff_otmp) snuff_light_source(mtmp->mx, mtmp->my); -#ifndef GOLDOBJ - } -#endif return freed_otmp; } @@ -686,35 +611,14 @@ boolean is_pet; /* If true, pet should keep wielded/worn items */ /* vault guard's gold goes away rather than be dropped... */ if (mtmp->isgd && -#ifdef GOLDOBJ (otmp = findgold(mtmp->minvent)) != 0 -#else - mtmp->mgold != 0L -#endif ) { if (canspotmon(mtmp)) pline("%s gold %s.", s_suffix(Monnam(mtmp)), canseemon(mtmp) ? "vanishes" : "seems to vanish"); -#ifdef GOLDOBJ obfree(otmp, (struct obj *)0); -#else - mtmp->mgold = 0L; -#endif } /* isgd && has gold */ -#ifndef GOLDOBJ - /* handle gold first since droppables() would get stuck on it */ - if (mtmp->mgold) { - long g = mtmp->mgold; - - (void) mkgold(g, omx, omy); - if (is_pet && cansee(omx, omy) && flags.verbose) - pline("%s drops %ld gold piece%s.", Monnam(mtmp), - g, plur(g)); - mtmp->mgold = 0L; - } -#endif - while ((otmp = (is_pet ? droppables(mtmp) : mtmp->minvent)) != 0) { obj_extract_self(otmp); mdrop_obj(mtmp, otmp, is_pet && flags.verbose); diff --git a/src/trap.c b/src/trap.c index cde767106..636598789 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3176,30 +3176,7 @@ boolean *lostsome; /* else continue */ } } -#ifndef GOLDOBJ - if (!otmp) { - /* Nothing available left to drop; try gold */ - if (u.ugold) { - pline("In desperation, you drop your purse."); - /* Hack: gold is not in the inventory, so make a gold object - * and put it at the head of the inventory list. - */ - obj = mkgoldobj(u.ugold); /* removes from u.ugold */ - obj->in_use = TRUE; - u.ugold = obj->quan; /* put the gold back */ - assigninvlet(obj); /* might end up as NOINVSYM */ - obj->nobj = invent; - invent = obj; - *lostsome = TRUE; - dropx(obj); - continue; /* Try again */ - } - /* We can't even drop gold! */ - return (FALSE); - } -#else if (!otmp) return (FALSE); /* nothing to drop! */ -#endif if (otmp->owornmask) remove_worn_item(otmp, FALSE); *lostsome = TRUE; dropx(otmp); diff --git a/src/u_init.c b/src/u_init.c index 09930dd11..bfe54671c 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -210,12 +210,10 @@ static struct trobj Wishing[] = { { WAN_WISHING, 3, WAND_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#ifdef GOLDOBJ static struct trobj Money[] = { { GOLD_PIECE, 0 , COIN_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#endif /* race-based substitutions for initial inventory; the weaker cloak for elven rangers is intentional--they shoot better */ @@ -597,11 +595,7 @@ u_init() skill_init(Skill_C); break; case PM_HEALER: -#ifndef GOLDOBJ - u.ugold = u.ugold0 = rn1(1000, 1001); -#else u.umoney0 = rn1(1000, 1001); -#endif ini_inv(Healer); if(!rn2(25)) ini_inv(Lamp); knows_object(POT_FULL_HEALING); @@ -650,11 +644,7 @@ u_init() break; case PM_ROGUE: Rogue[R_DAGGERS].trquan = rn1(10, 6); -#ifndef GOLDOBJ - u.ugold = u.ugold0 = 0; -#else u.umoney0 = 0; -#endif ini_inv(Rogue); if(!rn2(5)) ini_inv(Blindfold); knows_object(SACK); @@ -670,11 +660,7 @@ u_init() break; case PM_TOURIST: Tourist[T_DARTS].trquan = rn1(20, 21); -#ifndef GOLDOBJ - u.ugold = u.ugold0 = rnd(1000); -#else u.umoney0 = rnd(1000); -#endif ini_inv(Tourist); if(!rn2(25)) ini_inv(Tinopener); else if(!rn2(25)) ini_inv(Leash); @@ -778,12 +764,8 @@ u_init() if (wizard) read_wizkit(); -#ifndef GOLDOBJ - u.ugold0 += hidden_gold(); /* in case sack has gold in it */ -#else if (u.umoney0) ini_inv(Money); u.umoney0 += hidden_gold(); /* in case sack has gold in it */ -#endif find_ac(); /* get initial ac value */ init_attr(75); /* init attribute values */ @@ -939,12 +921,10 @@ register struct trobj *trop; nocreate4 = otyp; } -#ifdef GOLDOBJ if (trop->trclass == COIN_CLASS) { /* no "blessed" or "identified" money */ obj->quan = u.umoney0; } else { -#endif if (objects[otyp].oc_uses_known) obj->known = 1; obj->dknown = obj->bknown = obj->rknown = 1; if (Is_container(obj) || obj->otyp == STATUE) { @@ -966,9 +946,7 @@ register struct trobj *trop; obj->spe = trop->trspe; if (trop->trbless != UNDEF_BLESS) obj->blessed = trop->trbless; -#ifdef GOLDOBJ } -#endif /* defined after setting otyp+quan + blessedness */ obj->owt = weight(obj); obj = addinv(obj); diff --git a/src/uhitm.c b/src/uhitm.c index 0057e573d..04ec05c11 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1461,13 +1461,6 @@ register struct attack *mattk; tmp = 0; break; case AD_SGLD: -#ifndef GOLDOBJ - if (mdef->mgold) { - u.ugold += mdef->mgold; - mdef->mgold = 0; - Your("purse feels heavier."); - } -#else /* This you as a leprechaun, so steal real gold only, no lesser coins */ { @@ -1484,7 +1477,6 @@ register struct attack *mattk; } } } -#endif exercise(A_DEX, TRUE); tmp = 0; break; diff --git a/src/vault.c b/src/vault.c index 487cb8e7c..87c13b31a 100644 --- a/src/vault.c +++ b/src/vault.c @@ -366,11 +366,7 @@ fnd: return; } verbalize("I don't know you."); -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (Deaf) { ; } else if (!umoney && !hidden_gold()) { @@ -513,12 +509,8 @@ register struct monst *grd; grd_in_vault = *in_rooms(grd->mx, grd->my, VAULT)? TRUE : FALSE; boolean disappear_msg_seen = FALSE, semi_dead = (grd->mhp <= 0); -#ifndef GOLDOBJ - register boolean u_carry_gold = ((u.ugold + hidden_gold()) > 0L); -#else long umoney = money_cnt(invent); register boolean u_carry_gold = ((umoney + hidden_gold()) > 0L); -#endif boolean see_guard, newspot = FALSE; if(!on_level(&(egrd->gdlevel), &u.uz)) return(-1); @@ -560,15 +552,9 @@ register struct monst *grd; if(egrd->warncnt == 3 && !Deaf) verbalize("I repeat, %sfollow me!", u_carry_gold ? ( -#ifndef GOLDOBJ - !u.ugold ? - "drop that hidden gold and " : - "drop that gold and ") : ""); -#else !umoney ? "drop that hidden money and " : "drop that money and ") : ""); -#endif if(egrd->warncnt == 7) { m = grd->mx; n = grd->my; @@ -654,13 +640,8 @@ letknow: if (m == u.ux && n == u.uy) { struct obj *gold = g_at(m,n); /* Grab the gold from between the hero's feet. */ -#ifndef GOLDOBJ - grd->mgold += gold->quan; - delobj(gold); -#else obj_extract_self(gold); add_to_minv(grd, gold); -#endif newsym(m,n); } else if (m == x && n == y) { mpickgold(grd); /* does a newsym */ @@ -828,30 +809,17 @@ void paygd() { register struct monst *grd = findgd(); -#ifndef GOLDOBJ - struct obj *gold; -#else long umoney = money_cnt(invent); struct obj *coins, *nextcoins; -#endif int gx,gy; char buf[BUFSZ]; -#ifndef GOLDOBJ - if (!u.ugold || !grd) return; -#else if (!umoney || !grd) return; -#endif if (u.uinvault) { Your("%ld %s goes into the Magic Memory Vault.", -#ifndef GOLDOBJ - u.ugold, - currency(u.ugold)); -#else umoney, currency(umoney)); -#endif gx = u.ux; gy = u.uy; } else { @@ -868,10 +836,6 @@ paygd() plname, mons[u.umonster].mname); make_grave(gx, gy, buf); } -#ifndef GOLDOBJ - place_object(gold = mkgoldobj(u.ugold), gx, gy); - stackobj(gold); -#else for (coins = invent; coins; coins = nextcoins) { nextcoins = coins->nobj; if (objects[coins->otyp].oc_class == COIN_CLASS) { @@ -880,7 +844,6 @@ paygd() stackobj(coins); } } -#endif mongone(grd); } diff --git a/src/wield.c b/src/wield.c index 32a3e1eb4..dbb5d271f 100644 --- a/src/wield.c +++ b/src/wield.c @@ -238,17 +238,10 @@ register struct obj *obj; static NEARDATA const char wield_objs[] = { ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, TOOL_CLASS, 0 }; -#ifdef GOLDOBJ static NEARDATA const char ready_objs[] = { COIN_CLASS, ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 }; static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */ { COIN_CLASS, ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 }; -#else -static NEARDATA const char ready_objs[] = - { ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 }; -static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */ - { ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 }; -#endif int dowield() diff --git a/src/zap.c b/src/zap.c index 173bee625..c4d98c33c 100644 --- a/src/zap.c +++ b/src/zap.c @@ -436,11 +436,7 @@ struct monst *mtmp; mstatusline(mtmp); if (notonhead) return; /* don't show minvent for long worm tail */ -#ifndef GOLDOBJ - if (mtmp->minvent || mtmp->mgold) { -#else if (mtmp->minvent) { -#endif for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) { otmp->dknown = 1; /* treat as "seen" */ if (Is_container(otmp) || otmp->otyp == STATUE) { @@ -3661,9 +3657,6 @@ const char *fltxt; obfree(otmp, (struct obj *)0); } } -#ifndef GOLDOBJ - mon->mgold = 0L; -#endif #undef oresist_disintegration diff --git a/sys/amiga/amirip.c b/sys/amiga/amirip.c index 00e98b12d..5b625ba6d 100644 --- a/sys/amiga/amirip.c +++ b/sys/amiga/amirip.c @@ -183,12 +183,7 @@ time_t when; tomb_text(buf); /* Put $ on stone */ - Sprintf(buf, "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else - done_money); -#endif + Sprintf(buf, "%ld Au", done_money); buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ tomb_text(buf); diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index 6e18ed12a..dd86e2d6e 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -233,11 +233,7 @@ void FormatStatusString(char* text, int format) (void) describe_level(nb=eos(nb)); Sprintf(nb = eos(nb), "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", showsyms[COIN_CLASS + SYM_OFF_O], -#ifndef GOLDOBJ - u.ugold, -#else money_cnt(invent), -#endif hp, hpmax, u.uen, u.uenmax, u.uac); if (Upolyd) diff --git a/util/makedefs.c b/util/makedefs.c index ad2186887..9102945ce 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -960,7 +960,6 @@ do_rumors() * */ #define IGNORED_FEATURES ( 0L \ - | (1L << 12) /* GOLDOBJ */ \ | (1L << 19) /* EXP_ON_BOTL */ \ | (1L << 20) /* SCORE_ON_BOTL */ \ | (1L << 27) /* ZEROCOMP */ \ @@ -993,9 +992,6 @@ make_version() | (1L << 6) #endif /* objects (10..14) */ -#ifdef GOLDOBJ - | (1L << 10) -#endif /* flag bits and/or other global variables (15..26) */ #ifdef TEXTCOLOR | (1L << 17) @@ -1239,9 +1235,6 @@ static const char *build_opts[] = { #ifdef MFLOPPY "floppy drive support", #endif -#ifdef GOLDOBJ - "gold object in inventories", -#endif #ifdef INSURANCE "insurance files for recovering from crashes", #endif diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index af412e25a..16ff7873b 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -2550,11 +2550,7 @@ void NetHackQtStatusWindow::updateStats() dlevel.setLabel(buf,(long)depth(&u.uz)); } -#ifndef GOLDOBJ - gold.setLabel("Au:", u.ugold); -#else gold.setLabel("Au:", money_cnt(invent)); -#endif if (u.mtimedone) { // You're a monster! @@ -3296,11 +3292,7 @@ static char** rip_line=0; Sprintf(rip_line[NAME_LINE], "%s", plname); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(rip_line[GOLD_LINE], "%ld Au", u.ugold); -#else Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/X11/winstat.c b/win/X11/winstat.c index 42462cbc3..ab65a168c 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -600,11 +600,7 @@ update_fancy_status(wp) case F_NAME: val = (long) 0L; break; /* special */ case F_DLEVEL: val = (long) 0L; break; /* special */ -#ifndef GOLDOBJ - case F_GOLD: val = (long) u.ugold; break; -#else case F_GOLD: val = money_cnt(invent); break; -#endif case F_HP: val = (long) (u.mtimedone ? (u.mh > 0 ? u.mh : 0): (u.uhp > 0 ? u.uhp : 0)); break; diff --git a/win/X11/wintext.c b/win/X11/wintext.c index 9b337d3b2..795b765a7 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -469,11 +469,7 @@ calculate_rip_text(int how, time_t when) /* Put $ on stone */ Sprintf(rip_line[GOLD_LINE], "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/gem/wingem.c b/win/gem/wingem.c index 87d175231..ccc076bdf 100644 --- a/win/gem/wingem.c +++ b/win/gem/wingem.c @@ -1088,11 +1088,7 @@ time_t when; Sprintf(rip_line[NAME_LINE], "%s", plname); /* Put $ on stone */ Sprintf(rip_line[GOLD_LINE], "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/gnome/gnbind.c b/win/gnome/gnbind.c index c48535a26..b001de04f 100644 --- a/win/gnome/gnbind.c +++ b/win/gnome/gnbind.c @@ -1183,12 +1183,7 @@ void gnome_outrip(winid wid, int how, time_t when) Strcat(ripString, buf); /* Put $ on stone */ - Sprintf(buf, "%ld Au\n", -#ifndef GOLDOBJ - u.ugold); -#else - done_money); -#endif + Sprintf(buf, "%ld Au\n", done_money); Strcat(ripString, buf); /* Put together death description */ diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 6e3841cc3..37e1d7bf6 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -434,9 +434,7 @@ void ghack_status_window_update_stats() const char* hung; const char* enc; static int firstTime=TRUE; -#ifdef GOLDOBJ long umoney; -#endif /* First, fill in the player name and the dungeon level */ strcpy(buf, plname); @@ -565,30 +563,17 @@ void ghack_status_window_update_stats() gtk_label_set( GTK_LABEL( chaLabel), buf); /* Now do the non-pixmaped stats (gold and such) */ -#ifndef GOLDOBJ - sprintf(buf,"Au:%ld", u.ugold); - if (lastAu < u.ugold && firstTime==FALSE) { -#else umoney = money_cnt(invent); sprintf(buf,"Au:%ld", umoney); if (lastAu < umoney && firstTime==FALSE) { -#endif /* Ok, this changed so add it to the highlighing list */ ghack_highlight_widget( goldLabel, normalStyle, greenStyle); } -#ifndef GOLDOBJ - else if (lastAu > u.ugold && firstTime==FALSE) { -#else else if (lastAu > umoney && firstTime==FALSE) { -#endif /* Ok, this changed so add it to the highlighing list */ ghack_highlight_widget( goldLabel, normalStyle, redStyle); } -#ifndef GOLDOBJ - lastAu = u.ugold; -#else lastAu = umoney; -#endif gtk_label_set( GTK_LABEL( goldLabel), buf); if (u.mtimedone) { diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 39776d87b..7d2177286 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1796,11 +1796,7 @@ void mswin_outrip(winid wid, int how, time_t when) putstr(wid, 0, buf); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(buf, "%ld Au", u.ugold); -#else Sprintf(buf, "%ld Au", done_money); -#endif buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ putstr(wid, 0, buf);