]> granicus.if.org Git - nethack/commitdiff
carrying capacity
authorcohrs <cohrs>
Sat, 22 Mar 2003 17:25:09 +0000 (17:25 +0000)
committercohrs <cohrs>
Sat, 22 Mar 2003 17:25:09 +0000 (17:25 +0000)
As suggested in the newsgroup, re-factor the calculation of carrcap
so that any change in strength or constitution affects your capacity.
The integer division was rounding off the result.

doc/fixes34.2
src/hack.c

index f23b53c34d8cc1c03cb24966dd3339a928d5fea3..cff339e317cebcb5f3f64db61533021870ec9fe0 100644 (file)
@@ -20,6 +20,7 @@ don't use hcolor() for trapped chest gases when you aren't hallucinating
 the age of a potion of oil from a bones file wasn't being handled correctly
 putting gold in a container on the shop floor wasn't credited the way
        gold already in the container when dropped was credited
+avoid integer division rounding error when calculating carrying capacity
 
 
 Platform- and/or Interface-Specific Fixes
index 8620d3c330922b3340817abf361018c04c4755a5..c9fd83d1d385cf0ae95998c566efbdeeffd313ba 100644 (file)
@@ -2111,7 +2111,7 @@ weight_cap()
 {
        register long carrcap;
 
-       carrcap = (((ACURRSTR + ACURR(A_CON))/2)+1)*50;
+       carrcap = 25*(ACURRSTR + ACURR(A_CON)) + 50;
        if (Upolyd) {
                /* consistent with can_carry() in mon.c */
                if (youmonst.data->mlet == S_NYMPH)