Closed backwardsEric closed 29 minutes ago
I haven't checked at all, but did have a similar error which was fixed in d17202062
This looks like it is specific to learning brands or slays (the special short sword is of Gondolin). The logic in Vanilla looks like it's wrong (and was wrong before your simplification three months ago). For brands, I suspect Vanilla should be using
if (!learn && !(allow_temp && player_has_temporary_brand(p, i))) {
continue;
}
which would simplify to "if (!learn) continue;" in NarSil with some other simplifications in the remainder of the loop since learn will always be true at that point.
In the main branch with https://github.com/NickMcConnell/NarSil/pull/756 applied (compiled from source on macOS with 'make -f Makefile.osx OPT="-O0 -g -DUSE_STATS -fsanitize=address -fsanitize=undefined"), I tried to work through the tutorial. After equipping the special short sword and using it on the orc soldier in the next room, the game exited on the message, "Error in flag_on(lore->flags, flag): FlagID[0] Size[10] FlagOff[4294967295] FlagBV[128]". After setting a breakpoint at the entry to quit() in the debugger and rerunning, the back trace at the point of the error message is: