]> granicus.if.org Git - nethack/commitdiff
prevent a panic splitbill: no resident shopkeeper
authorcohrs <cohrs>
Sun, 3 Oct 2004 22:14:36 +0000 (22:14 +0000)
committercohrs <cohrs>
Sun, 3 Oct 2004 22:14:36 +0000 (22:14 +0000)
Patch was sent in by <Someone> on Sep 8:
This bug causes a number of impossible messages (starting with splitbill:
no resident shopkeeper??)

Repeat by:

Enter a large shop.
Wish for a large stack of projectiles.
Sell your projectiles and then pick them up again.
Trap shopkeeper against the door with a scroll of earth.
Throw the projectiles at the shopkeeper to anger him.
Move away from the boulder trap and wait for the shopkeeper to leave the
shop.
Throw one of the projectiles at the free space.

doc/fixes34.4
src/shk.c

index c801cd4b2f17f0f4b1896365a30bf5aa8be1579b..b5f5ee46fc4af37381dd569ed9c56140a49b1cf5 100644 (file)
@@ -54,6 +54,7 @@ ensure that a sleeping steed doesn't answer a #chat
 eliminate two very minor anomalies when using Luck to adjust random numbers
 destroying a worn item via dipping in burning oil would not unwear/unwield
        the item properly, possibly leading to various strange behaviors
+avoid a panic splitbill when shopkeeper is trapped by the door
 
 
 Platform- and/or Interface-Specific Fixes
index b23226f8b40a031e0631be2100ab63810c905a39..60a74eba871e1d67cc79a1837a2620212c2b2cf5 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -3228,7 +3228,7 @@ register struct monst *shkp;
                    Such voluntary abandonment left unpaid objects in
                    invent, triggering billing impossibilities on the
                    next level once the character fell through the hole.] */
-               if (udist > 4 && eshkp->following)
+               if (udist > 4 && eshkp->following && !eshkp->billct)
                    return(-1); /* leave it to m_move */
                gx = u.ux;
                gy = u.uy;