Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amulet mat fix #8

Merged
merged 2 commits into from
Sep 14, 2019
Merged

Amulet mat fix #8

merged 2 commits into from
Sep 14, 2019

Conversation

ogmobot
Copy link
Contributor

@ogmobot ogmobot commented Sep 14, 2019

I noticed some dumplogs (e.g. mine and ShivanHunter's) weren't very accurate about amulet materials when listing valuables at the end of the file. For instance, my blessed mithril amulet of unchanging became 1 gold amulet of unchanging. This patch keeps track of amulet type and material separately to fix that. (Downside: instead of 8 amulets of life saving(!), ShivanHunter would have had 3 silver amulets of life saving, 2 copper amulets of life saving, 2 amulets of life saving, 1 gold amulet of life saving -- a bit more of a mouthful.)
This patch also changes the price of the amulets based on their materials. Instead of all being worth 150zm, their value is scaled up by the matprices from shk.c (so silver amulets are worth 450zm, for example).

Previously, when listing valuables retrieved from the dungeon, the listed material for each amulet didn't necessarily reflect the materials of amulets in the player's inventory. This commit also modifies the worth of each amulet to be in line with what shopkeepers charge for them.
@k21971 k21971 merged commit 11eef76 into k21971:master Sep 14, 2019
k21971 pushed a commit that referenced this pull request Sep 1, 2023
On GitHub issue 1090, Rhialto wrote:
Hi! I am currently in the process of adapting the pkgsrc packaging of NetHack 3.6.7 to include the curses window option. A bit late perhaps...

While working on that, I ran into a case of a NULL pointer being used. Apparently when linking with ncurses, this doesn't cause problems, but NetBSD's own curses doesn't like it, and crashes the game.

Here is the stack trace. It happens when #quitting, I think just before the high scores are about to be shown (but I guess it should show in the stack trace if I'm totally correct with that):

(gdb) bt
 #0  redrawwin (win=0x0) at /usr/src/lib/libcurses/touchwin.c:149
 #1  0x0000000017e104b4 in curses_refresh_nethack_windows () at ../win/curses/curswins.c:176
 #2  0x0000000017e1054a in curses_destroy_win (win=win@entry=0x7ad219520540) at ../win/curses/curswins.c:155
 #3  0x0000000017e1512c in curses_display_nhmenu (wid=<optimized out>, how=<optimized out>, _selected=0x7f7fff65d850) at ../win/curses/cursdial.c:771
 #4  0x0000000017e0ff81 in curses_select_menu (wid=wid@entry=21, how=how@entry=0, selected=selected@entry=0x7f7fff65d850) at ../win/curses/cursmain.c:607
 #5  0x0000000017e10257 in curses_display_nhwindow (wid=21, block=1) at ../win/curses/cursmain.c:385
 #6  0x0000000017ca8075 in really_done (how=<optimized out>, how@entry=13) at end.c:1609
 #7  0x0000000017ca993f in done (how=how@entry=13) at end.c:1201
 #8  0x0000000017ca9c85 in done2 () at end.c:381
 #9  done2 () at end.c:337
 #10 0x0000000017c489da in doextcmd () at cmd.c:363
 #11 0x0000000017c57e94 in rhack (cmd=<optimized out>, cmd@entry=0x0) at cmd.c:4909
 #12 0x0000000017c265da in moveloop (resuming=<optimized out>) at allmain.c:435
 #13 0x0000000017e1b862 in main (argc=<optimized out>, argv=<optimized out>) at ../sys/unix/unixmain.c:351
status_window is NULL here. Simply checking for NULL avoids the problem. I added checks for the other windows as well, while I was there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants