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:
@@ -1206,7 +1206,7 @@ trapeffect_arrow_trap(
|
||||
} else {
|
||||
place_object(otmp, u.ux, u.uy);
|
||||
if (!Blind)
|
||||
otmp->dknown = 1;
|
||||
observe_object(otmp);
|
||||
stackobj(otmp);
|
||||
newsym(u.ux, u.uy);
|
||||
}
|
||||
@@ -1276,7 +1276,7 @@ trapeffect_dart_trap(
|
||||
} else {
|
||||
place_object(otmp, u.ux, u.uy);
|
||||
if (!Blind)
|
||||
otmp->dknown = 1;
|
||||
observe_object(otmp);
|
||||
stackobj(otmp);
|
||||
newsym(u.ux, u.uy);
|
||||
}
|
||||
@@ -1352,7 +1352,7 @@ trapeffect_rocktrap(
|
||||
harmless = TRUE;
|
||||
}
|
||||
if (!Blind)
|
||||
otmp->dknown = 1;
|
||||
observe_object(otmp);
|
||||
stackobj(otmp);
|
||||
newsym(u.ux, u.uy); /* map the rock */
|
||||
|
||||
@@ -5738,7 +5738,7 @@ untrap_box(
|
||||
else
|
||||
pline("There's a trap on %s.", the(xname(box)));
|
||||
box->tknown = 1;
|
||||
box->dknown = 1;
|
||||
observe_object(box);
|
||||
if (!confused)
|
||||
exercise(A_WIS, TRUE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user