Monster known traps bit twiddling

This commit is contained in:
Pasi Kallinen
2022-08-21 11:36:39 +03:00
parent 96e9534289
commit 953d43f5ac
10 changed files with 47 additions and 18 deletions

View File

@@ -45,7 +45,7 @@ mb_trapped(struct monst *mtmp, boolean canseeit)
return TRUE;
/* will get here if lifesaved */
}
mtmp->mtrapseen |= (1 << (TRAPPED_DOOR - 1));
mon_learns_traps(mtmp, TRAPPED_DOOR);
return FALSE;
}
@@ -1945,7 +1945,7 @@ undesirable_disp(
/* Monsters avoid a trap if they've seen that type before */
} else if (trap && rn2(40)
&& (mtmp->mtrapseen & (1 << (trap->ttyp - 1))) != 0) {
&& mon_knows_traps(mtmp, trap->ttyp)) {
return TRUE;
}