Skip to content

Commit

Permalink
#looting magic chests autoselects alignment keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
elunna committed Oct 28, 2023
1 parent 30b9d24 commit f2af728
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/invent.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ register int type;

for (otmp = invent; otmp; otmp = otmp->nobj)
if (otmp->otyp == type)
return otmp;
return otmp;
return (struct obj *) 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ boolean opening; /* True: key, pick, or card; False: key or pick */
} else {
switch (o->otyp) {
case SKELETON_KEY:
if (!key || is_roguish_key(&youmonst, o))
if (!key || is_roguish_key(&youmonst, o) || is_artikey(o))
key = o;
break;
case MAGIC_KEY:
Expand Down
8 changes: 8 additions & 0 deletions src/pickup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,14 @@ int cindex, ccount; /* index of this container (1..N), number of them (N) */
but don't give that away by suggesting them (same logic
as with crystal chests [see below comment]) */
unlocktool = carrying(MAGIC_KEY);
if (!unlocktool)
unlocktool = carrying_arti(ART_KEY_OF_LAW);
if (!unlocktool)
unlocktool = carrying_arti(ART_KEY_OF_CHAOS);
if (!unlocktool)
unlocktool = carrying_arti(ART_KEY_OF_NEUTRALITY);
if (!unlocktool)
unlocktool = carrying_arti(ART_KEY_OF_ACCESS);
break;
default:
/* Don't prompt for crystal chest; only artifact unlocking
Expand Down

0 comments on commit f2af728

Please sign in to comment.