Fix for GitLab issue #40: Inconsistant inventory space

This commit is contained in:
Eric S. Raymond 2018-03-10 17:58:46 -05:00
parent 782c5c3f29
commit 6de0149f9e
3 changed files with 562 additions and 2 deletions

13
misc.c
View file

@ -585,7 +585,9 @@ void carry(obj_t object, loc_t where)
if (game.place[object] == CARRIED)
return;
game.place[object] = CARRIED;
++game.holdng;
if (object!= BIRD)
++game.holdng;
}
if (game.atloc[where] == object) {
game.atloc[where] = game.link[object];
@ -606,7 +608,14 @@ void drop(obj_t object, loc_t where)
game.fixed[object - NOBJECTS] = where;
else {
if (game.place[object] == CARRIED)
--game.holdng;
if (object != BIRD)
/* The bird has to be weightless. This ugly hack (and the
* corresponding code in the drop function) brought to you
* by the fact that when the bird is caged, we need to be able
* to either 'take bird' or 'take cage' and have the right thing
* happen.
*/
--game.holdng;
game.place[object] = where;
}
if (where == LOC_NOWHERE ||