Mercurial > hg > early-roguelike
diff arogue5/mdport.c @ 145:aac28331e71d
Advanced Rogue family: fix the "score" option.
Changing the score file (when permitted) now works again, closing the
old score file and opening the new one.
author | John "Elwin" Edwards |
---|---|
date | Wed, 20 May 2015 08:42:17 -0400 |
parents | 65f3da34578a |
children | 600873555ec0 |
line wrap: on
line diff
--- a/arogue5/mdport.c Mon May 18 10:53:22 2015 -0400 +++ b/arogue5/mdport.c Wed May 20 08:42:17 2015 -0400 @@ -695,6 +695,17 @@ #endif } +extern int scorefd; +extern char score_file[]; + +void +md_reopen_score(void) +{ + if (scorefd > 0) + close(scorefd); + scorefd = open(score_file, O_RDWR | O_CREAT, 0666); +} + /* Cursor/Keypad Support