--- deliantra/server/common/treasure.C 2009/11/10 16:29:20 1.94 +++ deliantra/server/common/treasure.C 2009/11/29 10:55:18 1.97 @@ -1,7 +1,7 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team * Copyright (©) 1992,2007 Frank Tore Johansen * @@ -836,8 +836,7 @@ op->randomitems = 0; } - if (difficulty < 1) - difficulty = 1; + max_it (difficulty, 1); if (INVOKE_OBJECT (ADD_BONUS, op, ARG_OBJECT (creator != op ? creator : 0), @@ -947,9 +946,7 @@ /* Handle healing and magic power potions */ if (op->stats.sp && !op->randomitems) { - object *tmp; - - tmp = get_archetype (spell_mapping[op->stats.sp]); + object *tmp = get_archetype (spell_mapping[op->stats.sp]); insert_ob_in_ob (tmp, op); op->stats.sp = 0; } @@ -967,7 +964,7 @@ if (op->inv && op->randomitems) { /* value multiplier is same as for scrolls */ - op->value = (op->value * op->inv->value); + op->value *= op->inv->value; op->level = op->inv->level / 2 + rndm (difficulty) + rndm (difficulty); } else @@ -978,6 +975,7 @@ if (!(flags & GT_ONLY_GOOD) && rndm (2)) SET_FLAG (op, FLAG_CURSED); + break; } @@ -1148,7 +1146,7 @@ * Allocate and return the pointer to an empty artifactlist structure. */ static artifactlist * -get_empty_artifactlist (void) +get_empty_artifactlist () { return salloc0 (); } @@ -1157,7 +1155,7 @@ * Allocate and return the pointer to an empty artifact structure. */ static artifact * -get_empty_artifact (void) +get_empty_artifact () { return salloc0 (); } @@ -1180,7 +1178,7 @@ * Builds up the lists of artifacts from the file in the libdir. */ void -init_artifacts (void) +init_artifacts () { static int has_been_inited = 0; char filename[MAX_BUF]; @@ -1210,8 +1208,8 @@ if (!strcmp (f.get_str (), "all")) break; - char *next, *cp = f.get_str (); - + const char *cp = f.get_str (); + char *next; do { if ((next = strchr (cp, ',')))