raceptr()

Add a routine for returning a ptr
to the correct race of monst.
Compensates for polyd and non-polyd player.
This commit is contained in:
nethack.allison
2002-12-30 01:42:36 +00:00
parent e8ca725e92
commit bbfd597a80
3 changed files with 15 additions and 4 deletions

View File

@@ -761,10 +761,7 @@ racial_exception(mon, obj)
struct monst *mon;
struct obj *obj;
{
struct permonst *ptr;
if (mon == &youmonst && !Upolyd) ptr = &mons[urace.malenum];
else ptr = mon->data;
const struct permonst *ptr = raceptr(mon);
/* Acceptable Exceptions: */
/* Allow hobbits to wear elven armor - LoTR */