A lot more cleanup to rust and water.

This commit is contained in:
Sean Hunt
2015-02-23 17:21:11 -05:00
parent d588210a77
commit 7e0d552b06
15 changed files with 206 additions and 267 deletions

View File

@@ -583,11 +583,28 @@ which_armor(mon, flag)
struct monst *mon;
long flag;
{
register struct obj *obj;
if (mon == &youmonst) {
switch (flag) {
case W_ARM: return uarm;
case W_ARMC: return uarmc;
case W_ARMH: return uarmh;
case W_ARMS: return uarms;
case W_ARMG: return uarmg;
case W_ARMF: return uarmf;
#ifdef TOURIST
case W_ARMU: return uarmu;
#endif
default:
impossible("bad flag in which_armor");
return 0;
}
} else {
register struct obj *obj;
for(obj = mon->minvent; obj; obj = obj->nobj)
if (obj->owornmask & flag) return obj;
return((struct obj *)0);
for(obj = mon->minvent; obj; obj = obj->nobj)
if (obj->owornmask & flag) return obj;
return((struct obj *)0);
}
}
/* remove an item of armor and then drop it */