From 18aab1ab12f8e5033629e8a701287a5645c8455c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 14 Nov 2017 19:32:31 +0200 Subject: [PATCH] Make shopkeepers bill hero for burying merchandise --- doc/fixes36.1 | 1 + src/dig.c | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index c064ebb7f..d78178c42 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -471,6 +471,7 @@ charisma affects the leeway in demon lord bribes make Vlad slightly tougher reduce the amount of gold laying on the floor locked chests and large boxes contain more stuff +make shopkeepers bill hero for burying merchandise Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository diff --git a/src/dig.c b/src/dig.c index 364d1cce6..497de8cd4 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1863,16 +1863,33 @@ bury_objs(x, y) int x, y; { struct obj *otmp, *otmp2; + struct monst *shkp; + long loss = 0L; + boolean costly; + + costly = ((shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) + && costly_spot(x, y)); if (level.objects[x][y] != (struct obj *) 0) { debugpline2("bury_objs: at <%d,%d>", x, y); } - for (otmp = level.objects[x][y]; otmp; otmp = otmp2) + for (otmp = level.objects[x][y]; otmp; otmp = otmp2) { + if (costly) { + loss += stolen_value(otmp, x, y, (boolean) shkp->mpeaceful, TRUE); + if (otmp->oclass != COIN_CLASS) + otmp->no_charge = 1; + } otmp2 = bury_an_obj(otmp, (boolean *) 0); + } /* don't expect any engravings here, but just in case */ del_engr_at(x, y); newsym(x, y); + + if (costly && loss) { + You("owe %s %ld %s for burying merchandise.", mon_nam(shkp), loss, + currency(loss)); + } } /* move objects from buriedobjlist to fobj/nexthere lists */