fix #H4418/#H4419 - #tip of gold inside shops

The #tip command tries to reduce verbosity by formatting drop messages
with just the object name instead of with full sentences, yielding
  Objects spill out: obj1, obj2, obj3, ..., objN.
where the trailing comma or period is included with each successive
object.  If an intervening message occurs, such "25 zorkmids are
added to your credit", the rest of the objects will no longer be
extending the original sentence and end up looking silly.
  Objects spill out: obj1, obj2,--More--
  25 zorkmids are added to your credit.  obj3, ..., objN.
This fix causes the post-interruption messages to revert to verbose
format.
  Objects spill out: obj1, obj2,--More--
  25 zorkmids are added to your credit.--More--
  obj3 drops to the floor.--More--
...
  objN drops to the floor.

The interrupting message still follows the comma of the partial
sentence, but I don't see any sane way to fix that other than to
abandon the terse format altogether, and doing that makes #tip way
too verbose when the container has a lot of items in it.  But #tip
inside shops now does that, since there will always be buy/not-
interested feedback interrupting the terse format in that situation.
For other situations, a full sentence message might end up following
a partial sentence list of dropped items.

There was a more significant bug.  Dropping a hero-owned container
with gold in it onto shop floor sold the gold to shk, giving hero
credit.  Subsequent #tip gave the hero credit for that same gold
when it spilled out.  addtobill(obj) relies on obj->ox,oy to
determine whether events are taking place in a shop, and #tip was
relying on placement onto floor to set those, too late for shop
billing.  The fix yields suboptimal results:  you're given credit
when you drop the container, then during #tip when you spill the
contents, credit for the gold is removed, then new credit for it
is given.  That's down to shop insanity, not tipping behavior.
This commit is contained in:
PatR
2016-06-27 17:20:28 -07:00
parent 6e56c796c9
commit 805f7c5644
4 changed files with 50 additions and 23 deletions

View File

@@ -305,6 +305,13 @@ make fireballs or cones of cold cast a skilled or higher not go through walls
prevent flying monsters from hovering over unreachable underwater objects
lembas wafer gives increased nutrition to elves, reduced nutrition to orcs;
cram ration gives increase nutrition to dwarves
when #tip's terse object drop format got interrupted by a regular message,
it continued using "obj2, obj3, ..." for subsequent objects, where
the sentence grammar no longer made sense (the interrupting message
still follows the comma of a partial sentence--attempting to fix that
seems hopeless; leaving it is better than always using verbose format)
for #tip inside shop, credit was incorrectly given for spilled gold if that
gold's stale location coordinates didn't happen to be inside the shop
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository