ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_misc.C
(Generate patch)

Comparing deliantra/server/server/c_misc.C (file contents):
Revision 1.37 by root, Wed Jan 17 22:13:10 2007 UTC vs.
Revision 1.89 by root, Sat Nov 17 23:40:03 2018 UTC

1/* 1/*
2 * CrossFire, A Multiplayer game for X-windows 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 4 * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team
5 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team 6 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (C) 1992 Frank Tore Johansen 7 * Copyright (©) 1992 Frank Tore Johansen
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * Deliantra is free software: you can redistribute it and/or modify it under
9 * it under the terms of the GNU General Public License as published by 10 * the terms of the Affero GNU General Public License as published by the
10 * the Free Software Foundation; either version 2 of the License, or 11 * Free Software Foundation, either version 3 of the License, or (at your
11 * (at your option) any later version. 12 * option) any later version.
12 * 13 *
13 * This program is distributed in the hope that it will be useful, 14 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 17 * GNU General Public License for more details.
17 * 18 *
18 * You should have received a copy of the GNU General Public License 19 * You should have received a copy of the Affero GNU General Public License
19 * along with this program; if not, write to the Free Software 20 * and the GNU General Public License along with this program. If not, see
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * <http://www.gnu.org/licenses/>.
21 * 22 *
22 * The authors can be reached via e-mail at <crossfire@schmorp.de> 23 * The authors can be reached via e-mail to <support@deliantra.net>
23 */ 24 */
24 25
25#include <global.h> 26#include <global.h>
26#include <loader.h>
27#include <sproto.h> 27#include <sproto.h>
28 28
29#include <dirent.h>
30
31/* Handles misc. input request - things like hash table, malloc, maps, 29/* Handles misc. input request - things like hash table, malloc, maps, etc */
32 * who, etc.
33 */
34
35/* This command dumps the body information for object *op.
36 * it doesn't care what the params are.
37 * This is mostly meant as a debug command.
38 */
39int
40command_body (object *op, char *params)
41{
42 int i;
43
44 /* Too hard to try and make a header that lines everything up, so just
45 * give a description.
46 */
47 new_draw_info (NDI_UNIQUE, 0, op, "The first column is the name of the body location.");
48 new_draw_info (NDI_UNIQUE, 0, op, "The second column is how many of those locations your body has.");
49 new_draw_info (NDI_UNIQUE, 0, op, "The third column is how many slots in that location are available.");
50 for (i = 0; i < NUM_BODY_LOCATIONS; i++)
51 {
52 /* really debugging - normally body_used should not be set to anything
53 * if body_info isn't also set.
54 */
55 if (op->body_info[i] || op->body_used[i])
56 {
57 new_draw_info_format (NDI_UNIQUE, 0, op, "%-30s %5d %5d", body_locations[i].use_name, op->body_info[i], op->body_used[i]);
58 }
59 }
60 if (!QUERY_FLAG (op, FLAG_USE_ARMOUR))
61 new_draw_info (NDI_UNIQUE, 0, op, "You are not allowed to wear armor");
62 if (!QUERY_FLAG (op, FLAG_USE_WEAPON))
63 new_draw_info (NDI_UNIQUE, 0, op, "You are not allowed to use weapons");
64
65 return 1;
66}
67
68
69int
70command_motd (object *op, char *params)
71{
72 display_motd (op);
73 return 1;
74}
75
76int
77command_bug (object *op, char *params)
78{
79 char buf[MAX_BUF];
80
81 if (params == NULL)
82 {
83 new_draw_info (NDI_UNIQUE, 0, op, "what bugs?");
84 return 1;
85 }
86 strcpy (buf, op->name);
87 strcat (buf, " bug-reports: ");
88 strncat (buf, ++params, MAX_BUF - strlen (buf));
89 buf[MAX_BUF - 1] = '\0';
90 bug_report (buf);
91 LOG (llevError, "%s\n", buf);
92 new_draw_info (NDI_ALL | NDI_UNIQUE, 1, NULL, buf);
93 new_draw_info (NDI_UNIQUE, 0, op, "OK, thanks!");
94 return 1;
95}
96
97/*
98 * Pretty much identical to current map_info, but on a bigger scale
99 * This function returns the name of the players current region, and
100 * a description of it. It is there merely for flavour text.
101 */
102void
103current_region_info (object *op)
104{
105 /*
106 * Ok I /suppose/ I should write a seperate function for this, but it isn't
107 * going to be /that/ slow, and won't get called much
108 */
109 region *r = get_region_by_name (get_name_of_region_for_map (op->map));
110
111 if (!r)
112 return;
113 /* This should only be possible if regions are not operating on this server. */
114
115 new_draw_info_format (NDI_UNIQUE, 0, op, "You are in %s. \n %s", get_region_longname (r), get_region_msg (r));
116}
117
118void
119current_map_info (object *op)
120{
121 maptile *m = op->map;
122
123 if (!m)
124 return;
125
126 new_draw_info_format (NDI_UNIQUE, 0, op, "%s (%s) in %s", &m->name, &m->path, get_name_of_region_for_map (m));
127
128 if (QUERY_FLAG (op, FLAG_WIZ))
129 {
130 new_draw_info_format (NDI_UNIQUE, 0, op,
131 "players:%d difficulty:%d size:%dx%d start:%dx%d timeout %ld",
132 m->players, m->difficulty, m->width, m->height, m->enter_x, m->enter_y, m->timeout);
133
134 }
135 if (m->msg)
136 new_draw_info (NDI_UNIQUE, NDI_NAVY, op, m->msg);
137}
138
139#ifdef DEBUG_MALLOC_LEVEL
140int
141command_malloc_verify (object *op, char *parms)
142{
143 extern int malloc_verify (void);
144
145 if (!malloc_verify ())
146 new_draw_info (NDI_UNIQUE, 0, op, "Heap is corrupted.");
147 else
148 new_draw_info (NDI_UNIQUE, 0, op, "Heap checks out OK.");
149 return 1;
150}
151#endif
152
153int
154command_whereabouts (object *op, char *params)
155{
156
157 region *reg;
158 player *pl;
159
160 /*
161 * reset the counter on the region, then use it to store the number of
162 * players there.
163 * I don't know how thread-safe this would be, I suspect not very....
164 */
165 for (reg = first_region; reg != NULL; reg = reg->next)
166 {
167 reg->counter = 0;
168 }
169 for_all_players (pl)
170 if (pl->ob->map != NULL)
171 get_region_by_map (pl->ob->map)->counter++;
172
173 /* we only want to print out by places with a 'longname' field... */
174 for (reg = first_region; reg != NULL; reg = reg->next)
175 {
176 if (reg->longname == NULL && reg->counter > 0)
177 {
178 if (reg->parent != NULL)
179 {
180 reg->parent->counter += reg->counter;
181 reg->counter = 0;
182 }
183 else /*uh oh, we shouldn't be here. */
184 LOG (llevError, "command_whereabouts() Region %s with no longname has no parent", reg->name);
185 }
186 }
187 new_draw_info_format (NDI_UNIQUE, 0, op, "In the world currently there are:");
188 for (reg = first_region; reg != NULL; reg = reg->next)
189 if (reg->counter > 0)
190 new_draw_info_format (NDI_UNIQUE, 0, op, "%u players in %s", reg->counter, get_region_longname (reg));
191 return 1;
192}
193
194typedef struct
195{
196 char namebuf[MAX_BUF];
197 int login_order;
198} chars_names;
199
200int
201command_afk (object *op, char *params)
202{
203 if ((op->contr->ns->afk = !op->contr->ns->afk))
204 new_draw_info (NDI_UNIQUE, 0, op, "You are no longer AFK");
205 else
206 new_draw_info (NDI_UNIQUE, 0, op, "You are now AFK");
207
208 return 1;
209}
210
211int
212command_mapinfo (object *op, char *params)
213{
214 current_map_info (op);
215 return 1;
216}
217
218int
219command_whereami (object *op, char *params)
220{
221 current_region_info (op);
222 return 1;
223}
224 30
225int 31int
226command_time (object *op, char *params) 32command_time (object *op, char *params)
227{ 33{
228 print_tod (op); 34 print_tod (op);
229 return 1;
230}
231
232int
233command_weather (object *op, char *params)
234{
235#if 0
236 int wx, wy, temp, sky;
237 char buf[MAX_BUF];
238
239 if (settings.dynamiclevel < 1)
240 return 1;
241
242 if (op->map == NULL)
243 return 1;
244
245 if (worldmap_to_weathermap (op->x, op->y, &wx, &wy, op->map) != 0)
246 return 1;
247
248 if (QUERY_FLAG (op, FLAG_WIZ))
249 {
250 /* dump the weather, Dm style! Yo! */
251 new_draw_info_format (NDI_UNIQUE, 0, op, "Real temp: %d", real_world_temperature (op->x, op->y, op->map));
252 new_draw_info_format (NDI_UNIQUE, 0, op, "Base temp: %d", weathermap[wx][wy].temp);
253 new_draw_info_format (NDI_UNIQUE, 0, op, "Humid: %d", weathermap[wx][wy].humid);
254 new_draw_info_format (NDI_UNIQUE, 0, op, "Wind: dir=%d speed=%d", weathermap[wx][wy].winddir, weathermap[wx][wy].windspeed);
255 new_draw_info_format (NDI_UNIQUE, 0, op, "Pressure: %d", weathermap[wx][wy].pressure);
256 new_draw_info_format (NDI_UNIQUE, 0, op, "Avg Elevation: %d", weathermap[wx][wy].avgelev);
257 new_draw_info_format (NDI_UNIQUE, 0, op, "Rainfall: %d Water: %d", weathermap[wx][wy].rainfall, weathermap[wx][wy].water);
258 }
259
260 temp = real_world_temperature (op->x, op->y, op->map);
261 new_draw_info_format (NDI_UNIQUE, 0, op, "It's currently %d degrees " "Centigrade out.", temp);
262
263 /* humid */
264 if (weathermap[wx][wy].humid < 20)
265 new_draw_info (NDI_UNIQUE, 0, op, "It is very dry.");
266 else if (weathermap[wx][wy].humid < 40)
267 new_draw_info (NDI_UNIQUE, 0, op, "It is very comfortable today.");
268 else if (weathermap[wx][wy].humid < 60)
269 new_draw_info (NDI_UNIQUE, 0, op, "It is a bit muggy.");
270 else if (weathermap[wx][wy].humid < 80)
271 new_draw_info (NDI_UNIQUE, 0, op, "It is muggy.");
272 else
273 new_draw_info (NDI_UNIQUE, 0, op, "It is uncomfortably muggy.");
274
275 /* wind */
276 switch (weathermap[wx][wy].winddir)
277 {
278 case 1:
279 sprintf (buf, "north");
280 break;
281 case 2:
282 sprintf (buf, "northeast");
283 break;
284 case 3:
285 sprintf (buf, "east");
286 break;
287 case 4:
288 sprintf (buf, "southeast");
289 break;
290 case 5:
291 sprintf (buf, "south");
292 break;
293 case 6:
294 sprintf (buf, "southwest");
295 break;
296 case 7:
297 sprintf (buf, "west");
298 break;
299 case 8:
300 sprintf (buf, "northwest");
301 break;
302 }
303 if (weathermap[wx][wy].windspeed < 5)
304 new_draw_info_format (NDI_UNIQUE, 0, op, "There is a mild breeze " "coming from the %s.", buf);
305 else if (weathermap[wx][wy].windspeed < 10)
306 new_draw_info_format (NDI_UNIQUE, 0, op, "There is a strong breeze " "coming from the %s.", buf);
307 else if (weathermap[wx][wy].windspeed < 15)
308 new_draw_info_format (NDI_UNIQUE, 0, op, "There is a light wind " "coming from the %s.", buf);
309 else if (weathermap[wx][wy].windspeed < 25)
310 new_draw_info_format (NDI_UNIQUE, 0, op, "There is a strong wind " "coming from the %s.", buf);
311 else if (weathermap[wx][wy].windspeed < 35)
312 new_draw_info_format (NDI_UNIQUE, 0, op, "There is a heavy wind " "coming from the %s.", buf);
313 else
314 new_draw_info_format (NDI_UNIQUE, 0, op, "The wind from the %s is " "incredibly strong!", buf);
315
316 sky = weathermap[wx][wy].sky;
317 if (temp <= 0 && sky > SKY_OVERCAST && sky < SKY_FOG)
318 sky += 10; /*let it snow */
319 switch (sky)
320 {
321 case SKY_CLEAR:
322 new_draw_info (NDI_UNIQUE, 0, op, "There isn''t a cloud in the sky.");
323 break;
324 case SKY_LIGHTCLOUD:
325 new_draw_info (NDI_UNIQUE, 0, op, "There are a few light clouds in the sky.");
326 break;
327 case SKY_OVERCAST:
328 new_draw_info (NDI_UNIQUE, 0, op, "The sky is cloudy and dreary.");
329 break;
330 case SKY_LIGHT_RAIN:
331 new_draw_info (NDI_UNIQUE, 0, op, "It is raining softly.");
332 break;
333 case SKY_RAIN:
334 new_draw_info (NDI_UNIQUE, 0, op, "It is raining.");
335 break;
336 case SKY_HEAVY_RAIN:
337 new_draw_info (NDI_UNIQUE, 0, op, "It is raining heavily.");
338 break;
339 case SKY_HURRICANE:
340 new_draw_info (NDI_UNIQUE, 0, op, "There is a heavy storm! You should go inside!");
341 break;
342 case SKY_FOG:
343 new_draw_info (NDI_UNIQUE, 0, op, "It''s foggy and miserable.");
344 break;
345 case SKY_HAIL:
346 new_draw_info (NDI_UNIQUE, 0, op, "It''s hailing out! Take cover!");
347 break;
348 case SKY_LIGHT_SNOW:
349 new_draw_info (NDI_UNIQUE, 0, op, "Snow is gently falling from the sky.");
350 break;
351 case SKY_SNOW:
352 new_draw_info (NDI_UNIQUE, 0, op, "It''s snowing out.");
353 break;
354 case SKY_HEAVY_SNOW:
355 new_draw_info (NDI_UNIQUE, 0, op, "The snow is falling very heavily now.");
356 break;
357 case SKY_BLIZZARD:
358 new_draw_info (NDI_UNIQUE, 0, op, "A full blown blizzard is in effect. You might want to take cover!");
359 break;
360 }
361#endif
362 return 1;
363}
364
365int
366command_archs (object *op, char *params)
367{
368 arch_info (op);
369 return 1;
370}
371
372int
373command_hiscore (object *op, char *params)
374{
375 display_high_score (op, op == NULL ? 9999 : 50, params);
376 return 1; 35 return 1;
377} 36}
378 37
379int 38int
380command_debug (object *op, char *params) 39command_debug (object *op, char *params)
386 { 45 {
387 sprintf (buf, "Global debug level is %d.", settings.debug); 46 sprintf (buf, "Global debug level is %d.", settings.debug);
388 new_draw_info (NDI_UNIQUE, 0, op, buf); 47 new_draw_info (NDI_UNIQUE, 0, op, buf);
389 return 1; 48 return 1;
390 } 49 }
391 if (op != NULL && !QUERY_FLAG (op, FLAG_WIZ)) 50
392 { 51 settings.debug = i;
393 new_draw_info (NDI_UNIQUE, 0, op, "Privileged command."); 52
394 return 1;
395 }
396 settings.debug = (enum LogLevel) FABS (i);
397 sprintf (buf, "Set debug level to %d.", i); 53 sprintf (buf, "Set debug level to %d.", i);
398 new_draw_info (NDI_UNIQUE, 0, op, buf); 54 new_draw_info (NDI_UNIQUE, 0, op, buf);
399 return 1; 55 return 1;
400} 56}
401
402 57
403/* 58/*
404 * Those dumps should be just one dump with good parser 59 * Those dumps should be just one dump with good parser
405 */ 60 */
406 61
417 } 72 }
418 return 0; 73 return 0;
419} 74}
420 75
421int 76int
422command_dumpfriendlyobjects (object *op, char *params)
423{
424 dump_friendly_objects ();
425 return 0;
426}
427
428int
429command_printlos (object *op, char *params)
430{
431 if (op)
432 print_los (op);
433 return 0;
434}
435
436
437int
438command_version (object *op, char *params) 77command_version (object *op, char *params)
439{ 78{
440 version (op); 79 version (op);
441 return 0; 80 return 0;
442}
443
444#ifndef BUG_LOG
445# define BUG_LOG "bug_log"
446#endif
447void
448bug_report (const char *reportstring)
449{
450 FILE *fp;
451
452 if ((fp = fopen (BUG_LOG, "a")) != NULL)
453 {
454 fprintf (fp, "%s\n", reportstring);
455 fclose (fp);
456 }
457 else
458 {
459 LOG (llevError, "Cannot write bugs file %s: %s\n", BUG_LOG, strerror (errno));
460 }
461}
462
463int
464command_output_sync (object *op, char *params)
465{
466 int val;
467
468 if (!params)
469 {
470 new_draw_info_format (NDI_UNIQUE, 0, op, "Output sync time is presently %d", op->contr->outputs_sync);
471 return 1;
472 }
473 val = atoi (params);
474 if (val > 0)
475 {
476 op->contr->outputs_sync = val;
477 new_draw_info_format (NDI_UNIQUE, 0, op, "Output sync time now set to %d", op->contr->outputs_sync);
478 }
479 else
480 new_draw_info (NDI_UNIQUE, 0, op, "Invalid value for output_sync.");
481
482 return 1;
483}
484
485int
486command_output_count (object *op, char *params)
487{
488 int val;
489
490 if (!params)
491 {
492 new_draw_info_format (NDI_UNIQUE, 0, op, "Output count is presently %d", op->contr->outputs_count);
493 return 1;
494 }
495 val = atoi (params);
496 if (val > 0)
497 {
498 op->contr->outputs_count = val;
499 new_draw_info_format (NDI_UNIQUE, 0, op, "Output count now set to %d", op->contr->outputs_count);
500 }
501 else
502 new_draw_info (NDI_UNIQUE, 0, op, "Invalid value for output_count.");
503
504 return 1;
505}
506
507int
508command_listen (object *op, char *params)
509{
510 int i;
511
512 if (params == NULL || !sscanf (params, "%d", &i))
513 {
514 new_draw_info_format (NDI_UNIQUE, 0, op, "Set listen to what (presently %d)?", op->contr->listening);
515 return 1;
516 }
517 op->contr->listening = (char) i;
518 new_draw_info_format (NDI_UNIQUE, 0, op, "Your verbose level is now %d.", i);
519 return 1;
520} 81}
521 82
522/* Prints out some useful information for the character. Everything we print 83/* Prints out some useful information for the character. Everything we print
523 * out can be determined by the docs, so we aren't revealing anything extra - 84 * out can be determined by the docs, so we aren't revealing anything extra -
524 * rather, we are making it convenient to find the values. params have 85 * rather, we are making it convenient to find the values. params have
527int 88int
528command_statistics (object *pl, char *params) 89command_statistics (object *pl, char *params)
529{ 90{
530 if (!pl->contr) 91 if (!pl->contr)
531 return 1; 92 return 1;
532 new_draw_info_format (NDI_UNIQUE, 0, pl, " Experience: %" PRId64, pl->stats.exp);
533 new_draw_info_format (NDI_UNIQUE, 0, pl, " Next Level: %" PRId64, level_exp (pl->level + 1, pl->expmul));
534 new_draw_info (NDI_UNIQUE, 0, pl, "\nStat Nat/Real/Max");
535 93
536 new_draw_info_format (NDI_UNIQUE, 0, pl, "Str %2d/ %3d/%3d", 94 dynbuf_text &msg = msg_dynbuf; msg.clear ();
537 pl->contr->orig_stats.Str, pl->stats.Str, 20 + pl->arch->clone.stats.Str); 95
538 new_draw_info_format (NDI_UNIQUE, 0, pl, "Dex %2d/ %3d/%3d", 96 msg << " Experience: " << pl->stats.exp << '\n'
539 pl->contr->orig_stats.Dex, pl->stats.Dex, 20 + pl->arch->clone.stats.Dex); 97 << " Next Level: " << level_exp (pl->level + 1, pl->expmul) << '\n'
540 new_draw_info_format (NDI_UNIQUE, 0, pl, "Con %2d/ %3d/%3d", 98 << "\n Stat Nat/Real/Max\n";
541 pl->contr->orig_stats.Con, pl->stats.Con, 20 + pl->arch->clone.stats.Con); 99
542 new_draw_info_format (NDI_UNIQUE, 0, pl, "Int %2d/ %3d/%3d", 100 for (int i = 0; i < NUM_STATS; ++i)
543 pl->contr->orig_stats.Int, pl->stats.Int, 20 + pl->arch->clone.stats.Int); 101 msg.printf (" %s %2d/ %3d/%3d\n", short_stat_name [i], pl->contr->orig_stats.stat (i), pl->stats.stat (i), 20 + pl->arch->stats.stat (i));
544 new_draw_info_format (NDI_UNIQUE, 0, pl, "Wis %2d/ %3d/%3d", 102
545 pl->contr->orig_stats.Wis, pl->stats.Wis, 20 + pl->arch->clone.stats.Wis); 103 msg << "\nYou are " << (pl->contr->peaceful ? "peaceful" : "hostile") << '.';
546 new_draw_info_format (NDI_UNIQUE, 0, pl, "Pow %2d/ %3d/%3d", 104
547 pl->contr->orig_stats.Pow, pl->stats.Pow, 20 + pl->arch->clone.stats.Pow); 105 pl->contr->infobox (MSG_CHANNEL ("statistics"), msg);
548 new_draw_info_format (NDI_UNIQUE, 0, pl, "Cha %2d/ %3d/%3d",
549 pl->contr->orig_stats.Cha, pl->stats.Cha, 20 + pl->arch->clone.stats.Cha);
550 new_draw_info_format (NDI_UNIQUE, 0, pl, "\nAttack Mode: %s", pl->contr->peaceful ? "Peaceful" : "Hostile");
551 106
552 /* Can't think of anything else to print right now */ 107 /* Can't think of anything else to print right now */
553 return 0; 108 return 0;
554} 109}
555 110
556int 111int
557command_fix_me (object *op, char *params) 112command_fix_me (object *op, char *params)
558{ 113{
559 sum_weight (op); 114 op->update_weight ();
560 op->update_stats (); 115 op->update_stats ();
561 return 1; 116 new_draw_info (NDI_UNIQUE, 0, op, "Your character was fixed.");
562}
563 117
564int
565command_players (object *op, char *paramss)
566{
567 char buf[MAX_BUF];
568 char *t;
569 DIR *Dir;
570
571 sprintf (buf, "%s/%s/", settings.localdir, settings.playerdir);
572 t = buf + strlen (buf);
573 if ((Dir = opendir (buf)) != NULL)
574 {
575 const struct dirent *Entry;
576
577 while ((Entry = readdir (Dir)))
578 {
579 /* skip '.' , '..' */
580 if (!((Entry->d_name[0] == '.' && Entry->d_name[1] == '\0') ||
581 (Entry->d_name[0] == '.' && Entry->d_name[1] == '.' && Entry->d_name[2] == '\0')))
582 {
583 struct stat Stat;
584
585 strcpy (t, Entry->d_name);
586 if (stat (buf, &Stat) == 0)
587 {
588 /* This was not posix compatible
589 * if ((Stat.st_mode & S_IFMT)==S_IFDIR) {
590 */
591 if (S_ISDIR (Stat.st_mode))
592 {
593 char buf2[MAX_BUF];
594 struct tm *tm = localtime (&Stat.st_mtime);
595
596 sprintf (buf2, "%s\t%04d %02d %02d %02d %02d %02d",
597 Entry->d_name, 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
598 new_draw_info (NDI_UNIQUE, 0, op, buf2);
599 }
600 }
601 }
602 }
603 }
604 closedir (Dir);
605 return 0;
606}
607
608
609
610int
611command_logs (object *op, char *params)
612{
613 new_draw_info (NDI_UNIQUE, 0, op, "Nobody is currently logging kills.");
614
615 return 1;
616}
617
618int
619command_applymode (object *op, char *params)
620{
621 unapplymode unapply = op->contr->unapply;
622 static const char *const types[] = { "nochoice", "never", "always" };
623
624 if (!params)
625 {
626 new_draw_info_format (NDI_UNIQUE, 0, op, "applymode is set to %s", types[op->contr->unapply]);
627 return 1;
628 }
629
630 if (!strcmp (params, "nochoice"))
631 op->contr->unapply = unapply_nochoice;
632 else if (!strcmp (params, "never"))
633 op->contr->unapply = unapply_never;
634 else if (!strcmp (params, "always"))
635 op->contr->unapply = unapply_always;
636 else
637 {
638 new_draw_info_format (NDI_UNIQUE, 0, op, "applymode: Unknown options %s, valid options are nochoice, never, always", params);
639 return 0;
640 }
641 new_draw_info_format (NDI_UNIQUE, 0, op, "Applymode %s set to %s",
642 (unapply == op->contr->unapply ? "" : " now"), types[op->contr->unapply]);
643 return 1; 118 return 1;
644} 119}
645 120
646int 121int
647command_bowmode (object *op, char *params) 122command_bowmode (object *op, char *params)
648{ 123{
649 bowtype_t oldtype = op->contr->bowtype; 124 bowtype_t oldtype = op->contr->bowtype;
650 static const char *const types[] = { "normal", "threewide", "spreadshot", "firenorth", 125 static const char *const types[] = {
126 "normal", "threewide", "spreadshot", "firenorth",
651 "firene", "fireeast", "firese", "firesouth", 127 "firene", "fireeast", "firese", "firesouth",
652 "firesw", "firewest", "firenw", "bestarrow" 128 "firesw", "firewest", "firenw", "bestarrow"
653 }; 129 };
654 char buf[MAX_BUF]; 130 char buf[MAX_BUF];
655 int i, found; 131 int i, found;
667 found++; 143 found++;
668 op->contr->bowtype = (bowtype_t) i; 144 op->contr->bowtype = (bowtype_t) i;
669 break; 145 break;
670 } 146 }
671 } 147 }
148
672 if (!found) 149 if (!found)
673 { 150 {
674 sprintf (buf, "bowmode: Unknown options %s, valid options are:", params); 151 sprintf (buf, "bowmode: Unknown options %s, valid options are:", params);
152
675 for (i = 0; i <= bow_bestarrow; i++) 153 for (i = 0; i <= bow_bestarrow; i++)
676 { 154 {
677 strcat (buf, " "); 155 strcat (buf, " ");
678 strcat (buf, types[i]); 156 strcat (buf, types[i]);
679 if (i < bow_nw) 157 if (i < bow_nw)
682 strcat (buf, "."); 160 strcat (buf, ".");
683 } 161 }
684 new_draw_info_format (NDI_UNIQUE, 0, op, buf); 162 new_draw_info_format (NDI_UNIQUE, 0, op, buf);
685 return 0; 163 return 0;
686 } 164 }
165
687 new_draw_info_format (NDI_UNIQUE, 0, op, "bowmode %s set to %s", (oldtype == op->contr->bowtype ? "" : "now"), types[op->contr->bowtype]); 166 new_draw_info_format (NDI_UNIQUE, 0, op, "bowmode %s set to %s", (oldtype == op->contr->bowtype ? "" : "now"), types[op->contr->bowtype]);
688 return 1; 167 return 1;
689} 168}
690 169
691int 170int
692command_petmode (object *op, char *params)
693{
694 petmode_t oldtype = op->contr->petmode;
695 static const char *const types[] = { "normal", "sad", "defend", "arena" };
696
697 if (!params)
698 {
699 new_draw_info_format (NDI_UNIQUE, 0, op, "petmode is set to %s", types[op->contr->petmode]);
700 return 1;
701 }
702
703 if (!strcmp (params, "normal"))
704 op->contr->petmode = pet_normal;
705 else if (!strcmp (params, "sad"))
706 op->contr->petmode = pet_sad;
707 else if (!strcmp (params, "defend"))
708 op->contr->petmode = pet_defend;
709 else if (!strcmp (params, "arena"))
710 op->contr->petmode = pet_arena;
711 else
712 {
713 new_draw_info_format (NDI_UNIQUE, 0, op,
714 "petmode: Unknown options %s, valid options are normal," "sad (seek and destroy), defend, arena", params);
715 return 0;
716 }
717 new_draw_info_format (NDI_UNIQUE, 0, op, "petmode %s set to %s", (oldtype == op->contr->petmode ? "" : "now"), types[op->contr->petmode]);
718 return 1;
719}
720
721int
722command_showpets (object *op, char *params) 171command_showpets (object *op, char *params)
723{ 172{
724 objectlink *obl, *next;
725 int counter = 0, target = 0; 173 int counter = 0, target = 0;
726 int have_shown_pet = 0; 174 int have_shown_pet = 0;
727 175
176 dynbuf_text &msg = msg_dynbuf; msg.clear ();
177
728 if (params != NULL) 178 if (params)
729 target = atoi (params); 179 target = atoi (params);
180
730 for (obl = first_friendly_object; obl != NULL; obl = next) 181 for (objectlink *obl = first_friendly_object; obl; obl = obl->next)
731 { 182 {
732 object *ob = obl->ob; 183 object *ob = obl->ob;
733 184
734 next = obl->next;
735 if (ob->owner == op) 185 if (ob->owner == op)
736 { 186 {
737 if (target == 0) 187 if (target == 0)
738 { 188 {
739 if (counter == 0) 189 if (counter == 0)
740 new_draw_info (NDI_UNIQUE, 0, op, "Pets:"); 190 msg << "T<Pets>\n\n";
191
741 new_draw_info_format (NDI_UNIQUE, 0, op, "%d %s - level %d", ++counter, &ob->name, ob->level); 192 msg.printf (" %3d %s, level %d\n", ++counter, &ob->name, ob->level);
742 } 193 }
743 else if (!have_shown_pet && ++counter == target) 194 else if (!have_shown_pet && ++counter == target)
744 { 195 {
745 new_draw_info_format (NDI_UNIQUE, 0, op, "level %d %s", ob->level, &ob->name); 196 msg.printf ("T<%s>\n\n"
746 new_draw_info_format (NDI_UNIQUE, 0, op, "%d/%d HP, %d/%d SP", ob->stats.hp, ob->stats.maxhp, ob->stats.sp, ob->stats.maxsp); 197 " level %d\n"
747 /* this is not a nice way to do this, it should be made to be more like the statistics command */ 198 " %d/%d HP, %d/%d SP\n"
748 new_draw_info_format (NDI_UNIQUE, 0, op, "Str %d", ob->stats.Str); 199 " Str %2d\n"
749 new_draw_info_format (NDI_UNIQUE, 0, op, "Dex %d", ob->stats.Dex); 200 " Dex %2d\n"
750 new_draw_info_format (NDI_UNIQUE, 0, op, "Con %d", ob->stats.Con); 201 " Con %2d\n"
751 new_draw_info_format (NDI_UNIQUE, 0, op, "Int %d", ob->stats.Int); 202 " Int %2d\n"
752 new_draw_info_format (NDI_UNIQUE, 0, op, "Wis %d", ob->stats.Wis); 203 " Wis %2d\n"
753 new_draw_info_format (NDI_UNIQUE, 0, op, "Cha %d", ob->stats.Cha); 204 " Cha %2d\n"
754 new_draw_info_format (NDI_UNIQUE, 0, op, "Pow %d", ob->stats.Pow); 205 " Pow %2d\n"
755 new_draw_info_format (NDI_UNIQUE, 0, op, "wc %d damage %d ac %d ", ob->stats.wc, ob->stats.dam, ob->stats.ac); 206 " wc %d damage %d ac %d\n",
207 &ob->name,
208 ob->level,
209 ob->stats.hp, ob->stats.maxhp, ob->stats.sp, ob->stats.maxsp,
210 ob->stats.Str,
211 ob->stats.Dex,
212 ob->stats.Con,
213 ob->stats.Int,
214 ob->stats.Wis,
215 ob->stats.Cha,
216 ob->stats.Pow,
217 ob->stats.wc, ob->stats.dam, ob->stats.ac);
218
756 have_shown_pet = 1; 219 have_shown_pet = 1;
757 } 220 }
758 } 221 }
759 } 222 }
223
760 if (counter == 0) 224 if (counter == 0)
761 new_draw_info (NDI_UNIQUE, 0, op, "you have no pets."); 225 msg << "you have no pets.";
762 else if (target != 0 && have_shown_pet == 0) 226 else if (target != 0 && have_shown_pet == 0)
763 new_draw_info (NDI_UNIQUE, 0, op, "no such pet."); 227 msg << "no such pet.";
764 return 0;
765}
766 228
767int 229 op->contr->infobox (MSG_CHANNEL ("pets"), msg);
768command_usekeys (object *op, char *params)
769{
770 usekeytype oldtype = op->contr->usekeys;
771 static const char *const types[] = { "inventory", "keyrings", "containers" };
772 230
773 if (!params)
774 {
775 new_draw_info_format (NDI_UNIQUE, 0, op, "usekeys is set to %s", types[op->contr->usekeys]);
776 return 1;
777 }
778
779 if (!strcmp (params, "inventory"))
780 op->contr->usekeys = key_inventory;
781 else if (!strcmp (params, "keyrings"))
782 op->contr->usekeys = keyrings;
783 else if (!strcmp (params, "containers"))
784 op->contr->usekeys = containers;
785 else
786 {
787 new_draw_info_format (NDI_UNIQUE, 0, op, "usekeys: Unknown options %s, valid options are inventory, keyrings, containers", params);
788 return 0;
789 }
790 new_draw_info_format (NDI_UNIQUE, 0, op, "usekeys %s set to %s", (oldtype == op->contr->usekeys ? "" : "now"), types[op->contr->usekeys]);
791 return 1; 231 return 0;
792} 232}
793 233
794int 234int
795command_resistances (object *op, char *params) 235command_resistances (object *op, char *params)
796{ 236{
797 int i; 237 dynbuf_text &msg = msg_dynbuf; msg.clear ();
798 238
799 if (!op) 239 msg << "Resistances:\n\n";
800 return 0;
801 240
802 for (i = 0; i < NROFATTACKS; i++) 241 for (int i = 0; i < NROFATTACKS; i++)
803 {
804 if (i == ATNR_INTERNAL) 242 if (i != ATNR_INTERNAL)
805 continue; 243 msg.printf (" %-20s %+4d\n", attacktype_desc [i], op->resist [i]);
806
807 new_draw_info_format (NDI_UNIQUE, 0, op, "%-20s %+5d", attacktype_desc[i], op->resist[i]);
808 }
809 244
810 /* If dragon player, let's display natural resistances */ 245 /* If dragon player, let's display natural resistances */
811 if (is_dragon_pl (op)) 246 if (op->is_dragon ())
812 {
813 int attack;
814 object *tmp;
815
816 for (tmp = op->inv; tmp != NULL; tmp = tmp->below) 247 for (object *tmp = op->inv; tmp; tmp = tmp->below)
817 {
818 if ((tmp->type == FORCE) && (strcmp (tmp->arch->name, "dragon_skin_force") == 0)) 248 if ((tmp->type == FORCE) && tmp->arch->archname == shstr_dragon_skin_force)
819 { 249 {
820 new_draw_info (NDI_UNIQUE, 0, op, "\nNatural skin resistances:"); 250 msg << "\nOf those, these are natural skin resistances:\n\n";
251
821 for (attack = 0; attack < NROFATTACKS; attack++) 252 for (int attack = 0; attack < NROFATTACKS; attack++)
822 {
823 if (atnr_is_dragon_enabled (attack)) 253 if (atnr_is_dragon_enabled (attack))
824 { 254 msg.printf (" %-20s %+4d\n", change_resist_msg [attack], tmp->resist [attack]);
825 new_draw_info_format (NDI_UNIQUE, 0, op, "%s: %d", change_resist_msg[attack], tmp->resist[attack]);
826 }
827 }
828 break;
829 }
830 }
831 }
832 255
833 return 0;
834}
835
836/*
837 * Actual commands.
838 * Those should be in small separate files (c_object.c, c_wiz.c, cmove.c,...)
839 */
840
841
842static void
843help_topics (object *op, int what)
844{
845 DIR *dirp;
846 struct dirent *de;
847 char filename[MAX_BUF], line[80];
848 int namelen, linelen = 0;
849
850 switch (what)
851 {
852 case 1:
853 sprintf (filename, "%s/wizhelp", settings.datadir);
854 new_draw_info (NDI_UNIQUE, 0, op, " Wiz commands:");
855 break;
856 case 3:
857 sprintf (filename, "%s/mischelp", settings.datadir);
858 new_draw_info (NDI_UNIQUE, 0, op, " Misc help:");
859 break;
860 default:
861 sprintf (filename, "%s/help", settings.datadir);
862 new_draw_info (NDI_UNIQUE, 0, op, " Commands:");
863 break;
864 }
865
866 if (!(dirp = opendir (filename)))
867 return;
868
869 line[0] = '\0';
870 while (de = readdir (dirp))
871 {
872 namelen = strlen (de->d_name);
873 if (namelen <= 2 && *de->d_name == '.' && (namelen == 1 || de->d_name[1] == '.'))
874 continue;
875 linelen += namelen + 1;
876 if (linelen > 42)
877 {
878 new_draw_info (NDI_UNIQUE, 0, op, line);
879 sprintf (line, " %s", de->d_name);
880 linelen = namelen + 1;
881 continue;
882 }
883 strcat (line, " ");
884 strcat (line, de->d_name);
885 }
886 new_draw_info (NDI_UNIQUE, 0, op, line);
887 closedir (dirp);
888}
889
890static void
891show_commands (object *op, int what)
892{
893 char line[80];
894 int i, size, namelen, linelen = 0;
895 CommArray_s *ap;
896 extern CommArray_s Commands[], WizCommands[];
897 extern const int CommandsSize, WizCommandsSize;
898
899 switch (what)
900 {
901 case 1:
902 ap = WizCommands;
903 size = WizCommandsSize;
904 new_draw_info (NDI_UNIQUE, 0, op, " Wiz commands:");
905 break; 256 break;
906 case 2:
907 ap = CommunicationCommands;
908 size = CommunicationCommandSize;
909 new_draw_info (NDI_UNIQUE, 0, op, " Communication commands:");
910 break;
911 default:
912 ap = Commands;
913 size = CommandsSize;
914 new_draw_info (NDI_UNIQUE, 0, op, " Commands:");
915 break;
916 }
917
918 line[0] = '\0';
919 for (i = 0; i < size; i++)
920 {
921 namelen = strlen (ap[i].name);
922 linelen += namelen + 1;
923 if (linelen > 42)
924 { 257 }
925 new_draw_info (NDI_UNIQUE, 0, op, line);
926 sprintf (line, " %s", ap[i].name);
927 linelen = namelen + 1;
928 continue;
929 }
930 strcat (line, " ");
931 strcat (line, ap[i].name);
932 }
933 new_draw_info (NDI_UNIQUE, 0, op, line);
934}
935 258
259 op->contr->infobox (MSG_CHANNEL ("resistances"), msg);
936 260
937int
938command_help (object *op, char *params)
939{
940 struct stat st;
941 FILE *fp;
942 char filename[MAX_BUF], line[MAX_BUF];
943 int len;
944
945 if (op != NULL)
946 clear_win_info (op);
947
948/*
949 * Main help page?
950 */
951 if (!params)
952 {
953 sprintf (filename, "%s/def_help", settings.datadir);
954 if ((fp = fopen (filename, "r")) == NULL)
955 {
956 LOG (llevError, "Cannot open help file %s: %s\n", filename, strerror (errno));
957 return 0;
958 }
959 while (fgets (line, MAX_BUF, fp))
960 {
961 line[MAX_BUF - 1] = '\0';
962 len = strlen (line) - 1;
963 if (line[len] == '\n')
964 line[len] = '\0';
965 new_draw_info (NDI_UNIQUE, 0, op, line);
966 }
967 fclose (fp);
968 return 0;
969 }
970
971 /*
972 * Topics list
973 */
974 if (!strcmp (params, "topics"))
975 {
976 help_topics (op, 3);
977 help_topics (op, 0);
978 if (QUERY_FLAG (op, FLAG_WIZ))
979 help_topics (op, 1);
980 return 0;
981 }
982
983 /*
984 * Commands list
985 */
986 if (!strcmp (params, "commands"))
987 {
988 show_commands (op, 0);
989 show_commands (op, 2); /* show comm commands */
990 if (QUERY_FLAG (op, FLAG_WIZ))
991 show_commands (op, 1);
992 return 0;
993 }
994
995 /*
996 * User wants info about command
997 */
998 if (strchr (params, '.') || strchr (params, ' ') || strchr (params, '/'))
999 {
1000 sprintf (line, "Illegal characters in '%s'", params);
1001 new_draw_info (NDI_UNIQUE, 0, op, line);
1002 return 0;
1003 }
1004
1005 sprintf (filename, "%s/mischelp/%s", settings.datadir, params);
1006 if (stat (filename, &st) || !S_ISREG (st.st_mode))
1007 {
1008 if (op)
1009 {
1010 sprintf (filename, "%s/help/%s", settings.datadir, params);
1011 if (stat (filename, &st) || !S_ISREG (st.st_mode))
1012 {
1013 if (QUERY_FLAG (op, FLAG_WIZ))
1014 {
1015 sprintf (filename, "%s/wizhelp/%s", settings.datadir, params);
1016 if (stat (filename, &st) || !S_ISREG (st.st_mode))
1017 goto nohelp;
1018 }
1019 else
1020 goto nohelp;
1021 }
1022 }
1023 }
1024
1025 /*
1026 * Found that. Just cat it to screen.
1027 */
1028 if ((fp = fopen (filename, "r")) == NULL)
1029 {
1030 LOG (llevError, "Cannot open help file %s: %s\n", filename, strerror (errno));
1031 return 0;
1032 }
1033 sprintf (line, "Help about '%s'", params);
1034 new_draw_info (NDI_UNIQUE, 0, op, line);
1035 while (fgets (line, MAX_BUF, fp))
1036 {
1037 line[MAX_BUF - 1] = '\0';
1038 len = strlen (line) - 1;
1039 if (line[len] == '\n')
1040 line[len] = '\0';
1041 new_draw_info (NDI_UNIQUE, 0, op, line);
1042 }
1043 fclose (fp);
1044 return 0;
1045
1046 /*
1047 * No_help -escape
1048 */
1049nohelp:
1050 sprintf (line, "No help available on '%s'", params);
1051 new_draw_info (NDI_UNIQUE, 0, op, line);
1052 return 0;
1053}
1054
1055
1056int
1057onoff_value (const char *line)
1058{
1059 int i;
1060
1061 if (sscanf (line, "%d", &i))
1062 return (i != 0);
1063 switch (line[0])
1064 {
1065 case 'o':
1066 switch (line[1])
1067 {
1068 case 'n':
1069 return 1; /* on */
1070 default:
1071 return 0; /* o[ff] */
1072 }
1073 case 'y': /* y[es] */
1074 case 'k': /* k[ylla] */
1075 case 's':
1076 case 'd':
1077 return 1;
1078 case 'n': /* n[o] */
1079 case 'e': /* e[i] */
1080 case 'u':
1081 default:
1082 return 0;
1083 }
1084}
1085
1086int
1087command_sound (object *op, char *params)
1088{
1089 if (op->contr->ns->sound)
1090 {
1091 op->contr->ns->sound = 0;
1092 new_draw_info (NDI_UNIQUE, 0, op, "Silence is golden...");
1093 }
1094 else
1095 {
1096 op->contr->ns->sound = 1;
1097 new_draw_info (NDI_UNIQUE, 0, op, "The sounds are enabled.");
1098 }
1099
1100 return 1; 261 return 0;
1101} 262}
1102 263
1103int 264int
1104command_title (object *op, char *params) 265command_title (object *op, char *params)
1105{ 266{
1110 new_draw_info (NDI_UNIQUE, 0, op, "You cannot change your title."); 271 new_draw_info (NDI_UNIQUE, 0, op, "You cannot change your title.");
1111 return 1; 272 return 1;
1112 } 273 }
1113 274
1114 /* dragon players cannot change titles */ 275 /* dragon players cannot change titles */
1115 if (is_dragon_pl (op)) 276 if (op->is_dragon ())
1116 { 277 {
1117 new_draw_info (NDI_UNIQUE, 0, op, "Dragons cannot change titles."); 278 new_draw_info (NDI_UNIQUE, 0, op, "Dragons cannot change titles.");
1118 return 1; 279 return 1;
1119 } 280 }
1120 281
1145 strcpy (op->contr->own_title, params); 306 strcpy (op->contr->own_title, params);
1146 return 1; 307 return 1;
1147} 308}
1148 309
1149int 310int
1150command_peaceful (object *op, char *params)
1151{
1152 new_draw_info (NDI_UNIQUE, 0, op,
1153 "You cannot change your peaceful setting with this command."
1154 " Please speak to the priest in the temple of Gorokh"
1155 " if you want to become hostile or in temple of Valriel" " if you want to become peaceful again.");
1156
1157/*
1158 if((op->contr->peaceful=!op->contr->peaceful))
1159 new_draw_info(NDI_UNIQUE, 0,op,"You will not attack other players.");
1160 else
1161 new_draw_info(NDI_UNIQUE, 0,op,"You will attack other players.");
1162*/
1163 return 1;
1164}
1165
1166int
1167command_wimpy (object *op, char *params)
1168{
1169 int i;
1170 char buf[MAX_BUF];
1171
1172 if (params == NULL || !sscanf (params, "%d", &i))
1173 {
1174 sprintf (buf, "Your current wimpy level is %d.", op->run_away);
1175 new_draw_info (NDI_UNIQUE, 0, op, buf);
1176 return 1;
1177 }
1178 sprintf (buf, "Your new wimpy level is %d.", i);
1179 new_draw_info (NDI_UNIQUE, 0, op, buf);
1180 op->run_away = i;
1181 return 1;
1182}
1183
1184int
1185command_brace (object *op, char *params)
1186{
1187 if (!params)
1188 op->contr->braced = !op->contr->braced;
1189 else
1190 op->contr->braced = onoff_value (params);
1191
1192 if (op->contr->braced)
1193 new_draw_info (NDI_UNIQUE, 0, op, "You are braced.");
1194 else
1195 new_draw_info (NDI_UNIQUE, 0, op, "Not braced.");
1196
1197 op->update_stats ();
1198 return 0;
1199}
1200
1201int
1202command_kill_pets (object *op, char *params) 311command_kill_pets (object *op, char *params)
1203{ 312{
1204 objectlink *obl, *next; 313 objectlink *obl, *next;
1205 int counter = 0, removecount = 0; 314 int counter = 0, removecount = 0;
1206 315
1207 if (params == NULL) 316 if (!params)
1208 { 317 {
1209 terminate_all_pets (op); 318 terminate_all_pets (op);
1210 new_draw_info (NDI_UNIQUE, 0, op, "Your pets have been killed."); 319 new_draw_info (NDI_UNIQUE, 0, op, "Your pets have been killed.");
1211 } 320 }
1212 else 321 else
1213 { 322 {
1214 int target = atoi (params); 323 int target = atoi (params);
1215 324
1216 for (obl = first_friendly_object; obl != NULL; obl = next) 325 for (obl = first_friendly_object; obl; obl = next)
1217 { 326 {
1218 object *ob = obl->ob; 327 object *ob = obl->ob;
1219 328
1220 next = obl->next; 329 next = obl->next;
330
1221 if (ob->owner == op) 331 if (ob->owner == op)
1222 if (++counter == target || (target == 0 && !strcasecmp (ob->name, params))) 332 if (++counter == target || (target == 0 && !strcasecmp (ob->name, params)))
1223 { 333 {
1224 ob->destroy (); 334 ob->destroy ();
1225 removecount++; 335 removecount++;
1226 } 336 }
1227 } 337 }
338
1228 if (removecount != 0) 339 if (removecount != 0)
1229 new_draw_info_format (NDI_UNIQUE, 0, op, "killed %d pets.\n", removecount); 340 new_draw_info_format (NDI_UNIQUE, 0, op, "killed %d pets.\n", removecount);
1230 else 341 else
1231 new_draw_info (NDI_UNIQUE, 0, op, "Couldn't find any suitable pets to kill.\n"); 342 new_draw_info (NDI_UNIQUE, 0, op, "Couldn't find any suitable pets to kill.\n");
1232 } 343 }
344
1233 return 0; 345 return 0;
1234} 346}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines