--- deliantra/server/common/readable.C 2007/01/06 14:42:29 1.17 +++ deliantra/server/common/readable.C 2007/01/18 19:42:09 1.19 @@ -1,26 +1,26 @@ /* - CrossFire, A Multiplayer game for X-windows - - Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team - Copyright (C) 2002 Mark Wedel & Crossfire Development Team - Copyright (C) 1992 Frank Tore Johansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - The authors can be reached via e-mail at -*/ + * CrossFire, A Multiplayer game for X-windows + * + * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team + * Copyright (C) 2002 Mark Wedel & Crossfire Development Team + * Copyright (C) 1992 Frank Tore Johansen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The authors can be reached via e-mail at + */ /* This file contains code relevant to the BOOKS hack -- designed @@ -923,35 +923,35 @@ { case 1: /*monster */ nbr = sizeof (mon_book_name) / sizeof (char *); - strcpy (name, mon_book_name[RANDOM () % nbr]); + strcpy (name, mon_book_name[rndm (nbr)]); break; case 2: /*artifact */ nbr = sizeof (art_book_name) / sizeof (char *); - strcpy (name, art_book_name[RANDOM () % nbr]); + strcpy (name, art_book_name[rndm (nbr)]); break; case 3: /*spellpath */ nbr = sizeof (path_book_name) / sizeof (char *); - strcpy (name, path_book_name[RANDOM () % nbr]); + strcpy (name, path_book_name[rndm (nbr)]); break; case 4: /*alchemy */ nbr = sizeof (formula_book_name) / sizeof (char *); - strcpy (name, formula_book_name[RANDOM () % nbr]); + strcpy (name, formula_book_name[rndm (nbr)]); break; case 5: /*gods */ nbr = sizeof (gods_book_name) / sizeof (char *); - strcpy (name, gods_book_name[RANDOM () % nbr]); + strcpy (name, gods_book_name[rndm (nbr)]); break; case 6: /*msg file */ default: if (book->weight > 2000) { /* based on weight */ nbr = sizeof (heavy_book_name) / sizeof (char *); - strcpy (name, heavy_book_name[RANDOM () % nbr]); + strcpy (name, heavy_book_name[rndm (nbr)]); } else if (book->weight < 2001) { nbr = sizeof (light_book_name) / sizeof (char *); - strcpy (name, light_book_name[RANDOM () % nbr]); + strcpy (name, light_book_name[rndm (nbr)]); } break; } @@ -977,27 +977,27 @@ { case 1: /* monster */ nbr = sizeof (mon_author) / sizeof (char *); - strcpy (name, mon_author[RANDOM () % nbr]); + strcpy (name, mon_author[rndm (nbr)]); break; case 2: /* artifacts */ nbr = sizeof (art_author) / sizeof (char *); - strcpy (name, art_author[RANDOM () % nbr]); + strcpy (name, art_author[rndm (nbr)]); break; case 3: /* spellpath */ nbr = sizeof (path_author) / sizeof (char *); - strcpy (name, path_author[RANDOM () % nbr]); + strcpy (name, path_author[rndm (nbr)]); break; case 4: /* alchemy */ nbr = sizeof (formula_author) / sizeof (char *); - strcpy (name, formula_author[RANDOM () % nbr]); + strcpy (name, formula_author[rndm (nbr)]); break; case 5: /* gods */ nbr = sizeof (gods_author) / sizeof (char *); - strcpy (name, gods_author[RANDOM () % nbr]); + strcpy (name, gods_author[rndm (nbr)]); break; case 6: /* msg file */ default: - strcpy (name, book_author[RANDOM () % nbr]); + strcpy (name, book_author[rndm (nbr)]); } sprintf (title, "of %s", name); @@ -1171,7 +1171,7 @@ /* Lets give the book a description to individualize it some */ char new_name[MAX_BUF]; - snprintf (new_name, MAX_BUF, "%s %s", book_descrpt[RANDOM () % nbr], old_name); + snprintf (new_name, MAX_BUF, "%s %s", book_descrpt[rndm (nbr)], old_name); book->name = new_name; }