comparison rogue4/extern.c @ 300:0250220d8cdd

Fix an assortment of compiler warnings. A few potential bugs were removed in the process. Much code cleanup remains to be done.
author John "Elwin" Edwards
date Fri, 22 Nov 2019 21:18:27 -0500
parents d3968e9cb98d
children acc3718f50ab
comparison
equal deleted inserted replaced
299:74351bf23e5e 300:0250220d8cdd
143 143
144 struct stats max_stats = INIT_STATS; /* The maximum for the player */ 144 struct stats max_stats = INIT_STATS; /* The maximum for the player */
145 145
146 struct room *oldrp; /* Roomin(&oldpos) */ 146 struct room *oldrp; /* Roomin(&oldpos) */
147 struct room rooms[MAXROOMS]; /* One for each room -- A level */ 147 struct room rooms[MAXROOMS]; /* One for each room -- A level */
148 #define NON {0, 0}
149 #define NON12 { NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, NON }
148 struct room passages[MAXPASS] = /* One for each passage */ 150 struct room passages[MAXPASS] = /* One for each passage */
149 { 151 {
150 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 152 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
151 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 153 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
152 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 154 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
153 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 155 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
154 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 156 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
155 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 157 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
156 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 158 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
157 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 159 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
158 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 160 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
159 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 161 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
160 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 }, 162 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 },
161 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, 0 } 163 { {0, 0}, {0, 0}, {0, 0}, 0, ISGONE|ISDARK, 0, NON12 }
162 }; 164 };
165 #undef NON12
166 #undef NON
163 167
164 #define ___ 1 168 #define ___ 1
165 #define XX 10 169 #define XX 10
166 struct monster monsters[26] = 170 struct monster monsters[26] =
167 { 171 {
274 { "teleport to", 5, 50 }, 278 { "teleport to", 5, 50 },
275 { "cancellation", 5, 280 }, 279 { "cancellation", 5, 280 },
276 }; 280 };
277 281
278 struct h_list helpstr[] = { 282 struct h_list helpstr[] = {
279 '?', " prints help", 283 { '?', " prints help" },
280 '/', " identify object", 284 { '/', " identify object" },
281 'h', " left", 285 { 'h', " left" },
282 'j', " down", 286 { 'j', " down" },
283 'k', " up", 287 { 'k', " up" },
284 'l', " right", 288 { 'l', " right" },
285 'y', " up & left", 289 { 'y', " up & left" },
286 'u', " up & right", 290 { 'u', " up & right" },
287 'b', " down & left", 291 { 'b', " down & left" },
288 'n', " down & right", 292 { 'n', " down & right" },
289 'H', " run left", 293 { 'H', " run left" },
290 'J', " run down", 294 { 'J', " run down" },
291 'K', " run up", 295 { 'K', " run up" },
292 'L', " run right", 296 { 'L', " run right" },
293 'Y', " run up & left", 297 { 'Y', " run up & left" },
294 'U', " run up & right", 298 { 'U', " run up & right" },
295 'B', " run down & left", 299 { 'B', " run down & left" },
296 'N', " run down & right", 300 { 'N', " run down & right" },
297 't', "<dir> throw something", 301 { 't', "<dir> throw something" },
298 'f', "<dir> forward until find something", 302 { 'f', "<dir> forward until find something" },
299 'z', "<dir> zap a wand in a direction", 303 { 'z', "<dir> zap a wand in a direction" },
300 '^', "<dir> identify trap type", 304 { '^', "<dir> identify trap type" },
301 's', " search for trap/secret door", 305 { 's', " search for trap/secret door" },
302 '>', " go down a staircase", 306 { '>', " go down a staircase" },
303 '<', " go up a staircase", 307 { '<', " go up a staircase" },
304 '.', " rest for a while", 308 { '.', " rest for a while" },
305 'i', " inventory", 309 { 'i', " inventory" },
306 'I', " inventory single item", 310 { 'I', " inventory single item" },
307 'q', " quaff potion", 311 { 'q', " quaff potion" },
308 'r', " read paper", 312 { 'r', " read paper" },
309 'e', " eat food", 313 { 'e', " eat food" },
310 'w', " wield a weapon", 314 { 'w', " wield a weapon" },
311 'W', " wear armor", 315 { 'W', " wear armor" },
312 'T', " take armor off", 316 { 'T', " take armor off" },
313 'P', " put on ring", 317 { 'P', " put on ring" },
314 'R', " remove ring", 318 { 'R', " remove ring" },
315 'd', " drop object", 319 { 'd', " drop object" },
316 'c', " call object", 320 { 'c', " call object" },
317 'D', " recall what's been discovered", 321 { 'D', " recall what's been discovered" },
318 'o', " examine/set options", 322 { 'o', " examine/set options" },
319 CTRL('L'), " redraw screen", 323 { CTRL('L'), " redraw screen" },
320 CTRL('R'), " repeat last message", 324 { CTRL('R'), " repeat last message" },
321 ESCAPE, " cancel command", 325 { ESCAPE, " cancel command" },
322 '!', " shell escape", 326 { '!', " shell escape" },
323 'S', " save game", 327 { 'S', " save game" },
324 'Q', " quit", 328 { 'Q', " quit" },
325 0, 0 329 { 0, 0 }
326 }; 330 };