fix github issue #154 - #loot in A-autoselect all
Fixes #154 With menustyle:Full, picking 'A - autoselect all' when putting items into a container ran code for taking things out and there wasn't any corresponding code for putting things in. Add some put-in-everything code. Taking things out doesn't offer 'A - autoselect all' as a choice so the code mentioned above may now be dead. Taking everything out seems like something that's much more likely to be desired than putting everything in.
This commit is contained in:
@@ -181,6 +181,8 @@ death from something other than loss of hit points could leave hero with
|
||||
added several special cases for genocide and/or wishing prompt: (cookie,
|
||||
pie, genie, watchmen)
|
||||
lightning strike from Mjollnir did not make any noise
|
||||
with menustyle:Full, picking 'A - autoselect all' when putting items into a
|
||||
container actually took everything out of that container
|
||||
|
||||
|
||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||
|
||||
25
src/pickup.c
25
src/pickup.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 pickup.c $NHDT-Date: 1516581051 2018/01/22 00:30:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.194 $ */
|
||||
/* NetHack 3.6 pickup.c $NHDT-Date: 1541292247 2018/11/04 00:44:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.200 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -2739,12 +2739,23 @@ boolean put_in;
|
||||
}
|
||||
|
||||
if (loot_everything) {
|
||||
current_container->cknown = 1;
|
||||
for (otmp = current_container->cobj; otmp; otmp = otmp2) {
|
||||
otmp2 = otmp->nobj;
|
||||
res = out_container(otmp);
|
||||
if (res < 0)
|
||||
break;
|
||||
if (!put_in) {
|
||||
current_container->cknown = 1;
|
||||
for (otmp = current_container->cobj; otmp; otmp = otmp2) {
|
||||
otmp2 = otmp->nobj;
|
||||
res = out_container(otmp);
|
||||
if (res < 0)
|
||||
break;
|
||||
n_looted += res;
|
||||
}
|
||||
} else {
|
||||
for (otmp = invent; otmp && current_container; otmp = otmp2) {
|
||||
otmp2 = otmp->nobj;
|
||||
res = in_container(otmp);
|
||||
if (res < 0)
|
||||
break;
|
||||
n_looted += res;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mflags = INVORDER_SORT;
|
||||
|
||||
Reference in New Issue
Block a user