Mercurial > hg > early-roguelike
comparison srogue/rip.c @ 306:057c5114e244
Super-Rogue: fix some out-of-range constants.
Constants K_ARROW etc., for causes of death other than monsters, are in
the 240-255 range. They were often passed to functions taking char,
which is usually signed, making the values out of range.
The function declarations have been changed to unsigned char, which is
also the type used by the scoreboard code.
author | John "Elwin" Edwards |
---|---|
date | Sat, 17 Apr 2021 15:41:12 -0400 |
parents | e52a8a7ad4c5 |
children |
comparison
equal
deleted
inserted
replaced
305:3900f3cfe07d | 306:057c5114e244 |
---|---|
59 * Do something really fun when he dies | 59 * Do something really fun when he dies |
60 */ | 60 */ |
61 | 61 |
62 #include <time.h> | 62 #include <time.h> |
63 void | 63 void |
64 death(char monst) | 64 death(unsigned char monst) |
65 { | 65 { |
66 reg char *killer; | 66 reg char *killer; |
67 int dp; | 67 int dp; |
68 struct tm *lt; | 68 struct tm *lt; |
69 time_t date; | 69 time_t date; |
120 /* | 120 /* |
121 * score: | 121 * score: |
122 * Figure score and post it. | 122 * Figure score and post it. |
123 */ | 123 */ |
124 void | 124 void |
125 score(int amount, int aflag, char monst) | 125 score(int amount, int aflag, unsigned char monst) |
126 { | 126 { |
127 reg struct sc_ent *scp, *sc2; | 127 reg struct sc_ent *scp, *sc2; |
128 reg int i, prflags = 0; | 128 reg int i, prflags = 0; |
129 char *packend; | 129 char *packend; |
130 | 130 |
217 refresh(); | 217 refresh(); |
218 endwin(); | 218 endwin(); |
219 showtop(prflags); /* print top ten list */ | 219 showtop(prflags); /* print top ten list */ |
220 } | 220 } |
221 | 221 |
222 void writelog(int amount, int aflag, char monst) | 222 void writelog(int amount, int aflag, unsigned char monst) |
223 { | 223 { |
224 char logmessage[220], ltemp[80], mlev[40]; | 224 char logmessage[220], ltemp[80], mlev[40]; |
225 char *killer; | 225 char *killer; |
226 | 226 |
227 if (waswizard) | 227 if (waswizard) |