limit obj manipulation by handless creatures
something that is M1_NOHANDS ought not to be able to pick up a pile of rocks, daggers, or gold pieces unless it has other features that would permit such a thing.
This commit is contained in:
19
src/mon.c
19
src/mon.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 mon.c $NHDT-Date: 1430396792 2015/04/30 12:26:32 $ $NHDT-Branch: master $:$NHDT-Revision: 1.169 $ */
|
||||
/* NetHack 3.5 mon.c $NHDT-Date: 1430433254 2015/04/30 22:34:14 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.171 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -938,6 +938,8 @@ struct obj *otmp;
|
||||
{
|
||||
int otyp = otmp->otyp, newload = otmp->owt;
|
||||
struct permonst *mdat = mtmp->data;
|
||||
short nattk = 0;
|
||||
boolean glomper = FALSE;
|
||||
|
||||
if (notake(mdat)) return FALSE; /* can't carry anything */
|
||||
|
||||
@@ -950,6 +952,21 @@ struct obj *otmp;
|
||||
(otyp != BELL_OF_OPENING || !is_covetous(mdat)))
|
||||
return FALSE;
|
||||
|
||||
/* monsters without hands can't pick up multiple objects at once
|
||||
* unless they have an engulfing attack
|
||||
*
|
||||
* ...dragons, of course, can always carry gold pieces somehow */
|
||||
if (otmp->quan > 1) {
|
||||
for (nattk = 0; nattk < NATTK; nattk++)
|
||||
glomper = (glomper || mtmp->data->mattk[nattk].aatyp == AT_ENGL);
|
||||
|
||||
if ((mtmp->data->mflags1 & M1_NOHANDS) && !glomper
|
||||
&& (!(mtmp->data->mlet == S_DRAGON
|
||||
&& otmp->oclass == COIN_CLASS))) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Steeds don't pick up stuff (to avoid shop abuse) */
|
||||
if (mtmp == u.usteed) return (FALSE);
|
||||
if (mtmp->isshk) return(TRUE); /* no limit */
|
||||
|
||||
Reference in New Issue
Block a user