From 2ae7f10dd9be2da67b3bc8ae4a8fa0452b3febaf Mon Sep 17 00:00:00 2001 From: cohrs Date: Sat, 22 Mar 2003 17:25:09 +0000 Subject: [PATCH] carrying capacity 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 | 1 + src/hack.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.2 b/doc/fixes34.2 index f23b53c34..cff339e31 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -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 diff --git a/src/hack.c b/src/hack.c index 8620d3c33..c9fd83d1d 100644 --- a/src/hack.c +++ b/src/hack.c @@ -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) -- 2.40.0