Accurately track which items have been discovered, even if not #named
This fixes a couple of bugs: a long-standing bug in which writing a scroll by label could fail even if you've already seen a scroll with that label (due to the game not tracking whether or not you've seen a scroll if it doesn't have a name); and a somewhat newer bug in which spellbooks auto-identified by Wizard knowledge were marked as having been encountered (rather than as known but not encountered). Breaks save file compatibility, but not bones files.
This commit is contained in:
@@ -334,7 +334,7 @@ ohitmon(
|
||||
ismimic = M_AP_TYPE(mtmp) && M_AP_TYPE(mtmp) != M_AP_MONSTER;
|
||||
vis = cansee(gb.bhitpos.x, gb.bhitpos.y);
|
||||
if (vis)
|
||||
otmp->dknown = 1;
|
||||
observe_object(otmp);
|
||||
|
||||
tmp = 5 + find_mac(mtmp) + omon_adj(mtmp, otmp, FALSE);
|
||||
/* High level monsters will be more likely to hit */
|
||||
@@ -652,7 +652,7 @@ m_throw(
|
||||
singleobj->ox = gb.bhitpos.x += dx;
|
||||
singleobj->oy = gb.bhitpos.y += dy;
|
||||
if (cansee(gb.bhitpos.x, gb.bhitpos.y))
|
||||
singleobj->dknown = 1;
|
||||
observe_object(singleobj);
|
||||
|
||||
mtmp = m_at(gb.bhitpos.x, gb.bhitpos.y);
|
||||
if (mtmp && shade_miss(mon, mtmp, singleobj, TRUE, TRUE)) {
|
||||
|
||||
Reference in New Issue
Block a user