@@ -45,23 +45,24 @@ int tombstone = TRUE; /* Print out tombstone at end */
4545#ifdef MASTER
4646int wizard = FALSE; /* True if allows wizard commands */
4747#endif
48- int pack_used [26 ] = { /* Is the character used in the pack? */
48+ int pack_used [MAXPACK + 1 ] = { /* Is the character used in the pack? +1 for paranoia */
4949 FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
5050 FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
51- FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
51+ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
52+ FALSE, /* paranoia */
5253};
5354
5455int dir_ch ; /* Direction from last get_dir() call */
55- char home [MAXSTR + 1 ] = {'\0' }; /* User's home directory plus a trailing /, +1 for paranoia */
56- char file_name [2 * MAXSTR + 1 ] = {'\0' }; /* home plus / plus rogue save file path, +1 for paranoia */
57- char lock_path [2 * MAXSTR + 1 ] = {'\0' }; /* home plus / plus rogue lock file path, +1 for paranoia */
58- char score_path [2 * MAXSTR + 1 ] = {'\0' }; /* home plus / plus rogue score file path, +1 for paranoia */
59- char huh [MAXSTR + 1 ]; /* The last message printed */
60- const char * p_colors [MAXPOTIONS ]; /* Colors of the potions */
61- char prbuf [PFBUF_LEN + 1 ] = {'\0' }; /* buffer for snprintfs, +1 for paranoia */
62- const char * r_stones [MAXRINGS ]; /* Stone settings of the rings */
56+ char home [MAXSTR + 1 ] = {'\0' }; /* User's home directory plus a trailing /, +1 for paranoia */
57+ char file_name [( 2 * MAXSTR ) + 1 ] = {'\0' }; /* home plus / plus rogue save file path, +1 for paranoia */
58+ char lock_path [( 2 * MAXSTR ) + 1 ] = {'\0' }; /* home plus / plus rogue lock file path, +1 for paranoia */
59+ char score_path [( 2 * MAXSTR ) + 1 ] = {'\0' }; /* home plus / plus rogue score file path, +1 for paranoia */
60+ char huh [MAXSTR + 1 ]; /* The last message printed, +1 for paranoia */
61+ const char * p_colors [MAXPOTIONS + 1 ]; /* Colors of the potions, +1 for paranoia */
62+ char prbuf [PFBUF_LEN + 1 ] = {'\0' }; /* buffer for snprintfs, +1 for paranoia */
63+ const char * r_stones [MAXRINGS + 1 ]; /* Stone settings of the rings, +1 for paranoia */
6364int runch ; /* Direction player is running */
64- char * s_names [MAXSCROLLS ]; /* Names of the scrolls */
65+ char * s_names [MAXSCROLLS + 1 ]; /* Names of the scrolls, +1 for paranoia */
6566int take ; /* Thing she is taking */
6667const char * ws_made [MAXSTICKS ]; /* What sticks are made of */
6768char * ws_type [MAXSTICKS ]; /* Is it a wand or a staff */
@@ -150,7 +151,7 @@ coord delta; /* Change indicated to get_dir() */
150151coord oldpos ; /* Position before last look() call */
151152coord stairs ; /* Location of staircase */
152153
153- PLACE places [MAXLINES * MAXCOLS ]; /* level map */
154+ PLACE places [( MAXLINES * MAXCOLS ) + 1 ]; /* level map, +1 for paranoia */
154155
155156THING * cur_armor ; /* What he is wearing */
156157THING * cur_ring [2 ]; /* Which rings are being worn */
@@ -169,8 +170,8 @@ WINDOW *hw = NULL; /* used as a scratch window */
169170struct stats max_stats = INIT_STATS ; /* The maximum for the player */
170171
171172struct room * oldrp ; /* Roomin(&oldpos) */
172- struct room rooms [MAXROOMS ]; /* One for each room -- A level */
173- struct room passages [MAXPASS ] = /* One for each passage */
173+ struct room rooms [MAXROOMS + 1 ]; /* One for each room -- A level, +1 for paranoia */
174+ struct room passages [MAXPASS + 1 ] = /* One for each passage, +1 for paranoia */
174175{
175176 { {0 , 0 }, {0 , 0 }, {0 , 0 }, 0 , ISGONE |ISDARK , 0 , {{0 ,0 }} },
176177 { {0 , 0 }, {0 , 0 }, {0 , 0 }, 0 , ISGONE |ISDARK , 0 , {{0 ,0 }} },
@@ -184,12 +185,13 @@ struct room passages[MAXPASS] = /* One for each passage */
184185 { {0 , 0 }, {0 , 0 }, {0 , 0 }, 0 , ISGONE |ISDARK , 0 , {{0 ,0 }} },
185186 { {0 , 0 }, {0 , 0 }, {0 , 0 }, 0 , ISGONE |ISDARK , 0 , {{0 ,0 }} },
186187 { {0 , 0 }, {0 , 0 }, {0 , 0 }, 0 , ISGONE |ISDARK , 0 , {{0 ,0 }} },
187- { {0 , 0 }, {0 , 0 }, {0 , 0 }, 0 , ISGONE |ISDARK , 0 , {{0 ,0 }} }
188+ { {0 , 0 }, {0 , 0 }, {0 , 0 }, 0 , ISGONE |ISDARK , 0 , {{0 ,0 }} },
189+ { {0 , 0 }, {0 , 0 }, {0 , 0 }, 0 , ISGONE |ISDARK , 0 , {{0 ,0 }} } /* paranoia */
188190};
189191
190192#define ___ 1
191193#define XX 10
192- struct monster monsters [26 ] =
194+ struct monster monsters [26 + 1 ] =
193195 {
194196/* Name CARRY FLAG str, exp, lvl, amr, hpt, dmg */
195197{ "aquator" , 0 , ISMEAN , { XX , 20 , 5 , 2 , ___ , "0x0/0x0" } },
@@ -219,22 +221,24 @@ struct monster monsters[26] =
219221{ "wraith" , 0 , 0 , { XX , 55 , 5 , 4 , ___ , "1x6" } },
220222{ "xeroc" , 30 , 0 , { XX ,100 , 7 , 7 , ___ , "4x4" } },
221223{ "yeti" , 30 , 0 , { XX , 50 , 4 , 6 , ___ , "1x6/1x6" } },
222- { "zombie" , 0 , ISMEAN , { XX , 6 , 2 , 8 , ___ , "1x8" } }
224+ { "zombie" , 0 , ISMEAN , { XX , 6 , 2 , 8 , ___ , "1x8" } },
225+ { "" , 0 , 0 , { 0 , 0 , 0 , 0 , 0 , "" } }, /* paranoia */
223226 };
224227#undef ___
225228#undef XX
226229
227- struct obj_info things [NUMTHINGS ] = {
230+ struct obj_info things [NUMTHINGS + 1 ] = {
228231 { 0 , 26 }, /* potion */
229232 { 0 , 36 }, /* scroll */
230233 { 0 , 16 }, /* food */
231234 { 0 , 7 }, /* weapon */
232235 { 0 , 7 }, /* armor */
233236 { 0 , 4 }, /* ring */
234237 { 0 , 4 }, /* stick */
238+ { 0 , 0 }, /* paranoia */
235239};
236240
237- struct obj_info arm_info [MAXARMORS ] = {
241+ struct obj_info arm_info [MAXARMORS + 1 ] = {
238242 { "leather armor" , 20 , 20 , NULL , FALSE },
239243 { "ring mail" , 15 , 25 , NULL , FALSE },
240244 { "studded leather armor" , 15 , 20 , NULL , FALSE },
@@ -243,8 +247,9 @@ struct obj_info arm_info[MAXARMORS] = {
243247 { "splint mail" , 10 , 80 , NULL , FALSE },
244248 { "banded mail" , 10 , 90 , NULL , FALSE },
245249 { "plate mail" , 5 , 150 , NULL , FALSE },
250+ { NULL , 0 , 0 , NULL , FALSE }, /* paranoia */
246251};
247- struct obj_info pot_info [MAXPOTIONS ] = {
252+ struct obj_info pot_info [MAXPOTIONS + 1 ] = {
248253 { "confusion" , 7 , 5 , NULL , FALSE },
249254 { "hallucination" , 8 , 5 , NULL , FALSE },
250255 { "poison" , 8 , 5 , NULL , FALSE },
@@ -259,8 +264,9 @@ struct obj_info pot_info[MAXPOTIONS] = {
259264 { "restore strength" , 13 , 130 , NULL , FALSE },
260265 { "blindness" , 5 , 5 , NULL , FALSE },
261266 { "levitation" , 6 , 75 , NULL , FALSE },
267+ { NULL , 0 , 0 , NULL , FALSE }, /* paranoia */
262268};
263- struct obj_info ring_info [MAXRINGS ] = {
269+ struct obj_info ring_info [MAXRINGS + 1 ] = {
264270 { "protection" , 9 , 400 , NULL , FALSE },
265271 { "add strength" , 9 , 400 , NULL , FALSE },
266272 { "sustain strength" , 5 , 280 , NULL , FALSE },
@@ -275,8 +281,9 @@ struct obj_info ring_info[MAXRINGS] = {
275281 { "teleportation" , 5 , 30 , NULL , FALSE },
276282 { "stealth" , 7 , 470 , NULL , FALSE },
277283 { "maintain armor" , 5 , 380 , NULL , FALSE },
284+ { NULL , 0 , 0 , NULL , FALSE }, /* paranoia */
278285};
279- struct obj_info scr_info [MAXSCROLLS ] = {
286+ struct obj_info scr_info [MAXSCROLLS + 1 ] = {
280287 { "monster confusion" , 7 , 140 , NULL , FALSE },
281288 { "magic mapping" , 4 , 150 , NULL , FALSE },
282289 { "hold monster" , 2 , 180 , NULL , FALSE },
@@ -295,8 +302,9 @@ struct obj_info scr_info[MAXSCROLLS] = {
295302 { "remove curse" , 7 , 105 , NULL , FALSE },
296303 { "aggravate monsters" , 3 , 20 , NULL , FALSE },
297304 { "protect armor" , 2 , 250 , NULL , FALSE },
305+ { NULL , 0 , 0 , NULL , FALSE }, /* paranoia */
298306};
299- struct obj_info weap_info [MAXWEAPONS + 1 ] = {
307+ struct obj_info weap_info [MAXWEAPONS + 1 + 1 ] = {
300308 { "mace" , 11 , 8 , NULL , FALSE },
301309 { "long sword" , 11 , 15 , NULL , FALSE },
302310 { "short bow" , 12 , 15 , NULL , FALSE },
@@ -307,8 +315,9 @@ struct obj_info weap_info[MAXWEAPONS + 1] = {
307315 { "shuriken" , 12 , 5 , NULL , FALSE },
308316 { "spear" , 12 , 5 , NULL , FALSE },
309317 { NULL , 0 }, /* DO NOT REMOVE: fake entry for dragon's breath */
318+ { NULL , 0 , 0 , NULL , FALSE }, /* paranoia */
310319};
311- struct obj_info ws_info [MAXSTICKS ] = {
320+ struct obj_info ws_info [MAXSTICKS + 1 ] = {
312321 { "light" , 12 , 250 , NULL , FALSE },
313322 { "invisibility" , 6 , 5 , NULL , FALSE },
314323 { "lightning" , 3 , 330 , NULL , FALSE },
@@ -323,6 +332,7 @@ struct obj_info ws_info[MAXSTICKS] = {
323332 { "teleport away" , 6 , 340 , NULL , FALSE },
324333 { "teleport to" , 6 , 50 , NULL , FALSE },
325334 { "cancellation" , 5 , 280 , NULL , FALSE },
335+ { NULL , 0 , 0 , NULL , FALSE }, /* paranoia */
326336};
327337
328338const struct h_list helpstr [] = {
0 commit comments