… | |
… | |
58 | |
58 | |
59 | sprintf (buf, "Set debug level to %d.", i); |
59 | sprintf (buf, "Set debug level to %d.", i); |
60 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
60 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
61 | return 1; |
61 | return 1; |
62 | } |
62 | } |
63 | |
|
|
64 | |
63 | |
65 | /* |
64 | /* |
66 | * Those dumps should be just one dump with good parser |
65 | * Those dumps should be just one dump with good parser |
67 | */ |
66 | */ |
68 | |
67 | |
… | |
… | |
266 | op->contr->infobox (MSG_CHANNEL ("resistances"), msg); |
265 | op->contr->infobox (MSG_CHANNEL ("resistances"), msg); |
267 | |
266 | |
268 | return 0; |
267 | return 0; |
269 | } |
268 | } |
270 | |
269 | |
271 | /* |
|
|
272 | * Actual commands. |
|
|
273 | * Those should be in small separate files (c_object.c, c_wiz.c, cmove.c,...) |
|
|
274 | */ |
|
|
275 | |
|
|
276 | int |
|
|
277 | onoff_value (const char *line) |
|
|
278 | { |
|
|
279 | int i; |
|
|
280 | |
|
|
281 | if (sscanf (line, "%d", &i)) |
|
|
282 | return (i != 0); |
|
|
283 | switch (line[0]) |
|
|
284 | { |
|
|
285 | case 'o': |
|
|
286 | switch (line[1]) |
|
|
287 | { |
|
|
288 | case 'n': |
|
|
289 | return 1; /* on */ |
|
|
290 | default: |
|
|
291 | return 0; /* o[ff] */ |
|
|
292 | } |
|
|
293 | case 'y': /* y[es] */ |
|
|
294 | case 'k': /* k[ylla] */ |
|
|
295 | case 's': |
|
|
296 | case 'd': |
|
|
297 | return 1; |
|
|
298 | case 'n': /* n[o] */ |
|
|
299 | case 'e': /* e[i] */ |
|
|
300 | case 'u': |
|
|
301 | default: |
|
|
302 | return 0; |
|
|
303 | } |
|
|
304 | } |
|
|
305 | |
|
|
306 | int |
270 | int |
307 | command_title (object *op, char *params) |
271 | command_title (object *op, char *params) |
308 | { |
272 | { |
309 | char buf[MAX_BUF]; |
273 | char buf[MAX_BUF]; |
310 | |
274 | |