--- deliantra/server/common/treasure.C 2007/09/04 05:43:21 1.65 +++ deliantra/server/common/treasure.C 2008/01/22 15:53:01 1.69 @@ -1,11 +1,11 @@ /* - * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. + * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team + * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team * Copyright (©) 1992,2007 Frank Tore Johansen * - * Crossfire TRT is free software: you can redistribute it and/or modify + * Deliantra 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 3 of the License, or * (at your option) any later version. @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * The authors can be reached via e-mail to + * The authors can be reached via e-mail to */ /* TREASURE_DEBUG does some checking on the treasurelists after loading. @@ -245,7 +245,7 @@ op->expand_tail (); - if (ob_blocked (op, creator->map, creator->x, creator->y)) + if (op->blocked (creator->map, creator->x, creator->y)) op->destroy (); else { @@ -491,23 +491,18 @@ int level_for_item (const object *op, int difficulty) { - int olevel = 0; - if (!op->inv) { LOG (llevError, "level_for_item: Object %s has no inventory!\n", &op->name); return 0; } - olevel = (int) (op->inv->level + (double) difficulty * (1 - drand48 () * drand48 () * 2)); + int olevel = op->inv->level + int (difficulty * (1. - rndm () * rndm () * 2.)); if (olevel <= 0) - olevel = rndm (1, MIN (op->inv->level, 1)); - - if (olevel > MAXLEVEL) - olevel = MAXLEVEL; + olevel = rndm (1, op->inv->level); - return olevel; + return min (olevel, MAXLEVEL); } /* @@ -1135,7 +1130,7 @@ static artifactlist * get_empty_artifactlist (void) { - return salloc0 (); + return salloc0 (); } /* @@ -1144,7 +1139,7 @@ static artifact * get_empty_artifact (void) { - return salloc0 (); + return salloc0 (); } /*