]> granicus.if.org Git - nethack/commitdiff
U384 - dopay impossible
authorcohrs <cohrs>
Mon, 24 Mar 2003 02:15:49 +0000 (02:15 +0000)
committercohrs <cohrs>
Mon, 24 Mar 2003 02:15:49 +0000 (02:15 +0000)
If you zapped a WoStriking while outside a shop and broke the door and 2
separate objects, the shopkeeper would come out to get paid but if you
tried, it would result in "dopay: not to shopkeeper?" due to stolen_value
not adding the cost of the 2nd object to the right accumulator.

doc/fixes34.2
src/shk.c

index d0f33b3ec500adc026888bfa6fc6f683c587077c..47f42eef52fa87b9aabb60ccd47006f00c946733 100644 (file)
@@ -24,6 +24,8 @@ avoid integer division rounding error when calculating carrying capacity
 don't lock/unlock a door while in a pit, to be consistent with door opening
 infravision should not make invisible player "visible" (it doesn't for monsters)
 Perseus statue should always be male
+charge correctly when breaking multiple objects with the same zap, avoids
+       a dopay: not to shopkeeper impossible
 
 
 Platform- and/or Interface-Specific Fixes
index 83de9671168a5c0c5094cb5efd4a00cb0896743d..2c0ac27c27b10aee4a039b73e34ad240b30de546 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -2441,7 +2441,13 @@ register boolean peaceful, silent;
        if(peaceful) {
            boolean credit_use = !!ESHK(shkp)->credit;
            value = check_credit(value, shkp);
-           ESHK(shkp)->debit += value;
+           /* 'peaceful' affects general treatment, but doesn't affect
+            * the fact that other code expects that all charges after the
+            * shopkeeper is angry are included in robbed, not debit */
+           if (ANGRY(shkp))
+               ESHK(shkp)->robbed += value;
+           else 
+               ESHK(shkp)->debit += value;
 
            if(!silent) {
                const char *still = "";