ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/treasure.c
(Generate patch)

Comparing deliantra/server/common/treasure.c (file contents):
Revision 1.1 by root, Fri Feb 3 07:11:41 2006 UTC vs.
Revision 1.2 by elmex, Tue Jul 11 16:50:16 2006 UTC

1 1
2/* 2/*
3 * static char *rcs_treasure_c = 3 * static char *rcs_treasure_c =
4 * "$Id: treasure.c,v 1.1 2006/02/03 07:11:41 root Exp $"; 4 * "$Id: treasure.c,v 1.2 2006/07/11 16:50:16 elmex Exp $";
5 */ 5 */
6 6
7/* 7/*
8 CrossFire, A Multiplayer game for X-windows 8 CrossFire, A Multiplayer game for X-windows
9 9
155 155
156#ifdef TREASURE_DEBUG 156#ifdef TREASURE_DEBUG
157/* recursived checks the linked list. Treasurelist is passed only 157/* recursived checks the linked list. Treasurelist is passed only
158 * so that the treasure name can be printed out 158 * so that the treasure name can be printed out
159 */ 159 */
160static void check_treasurelist(treasure *t, treasurelist *tl) 160static void check_treasurelist(const treasure *t, const treasurelist *tl)
161{ 161{
162 if (t->item==NULL && t->name==NULL) 162 if (t->item==NULL && t->name==NULL)
163 LOG(llevError,"Treasurelist %s has element with no name or archetype\n", tl->name); 163 LOG(llevError,"Treasurelist %s has element with no name or archetype\n", tl->name);
164 if (t->chance>=100 && t->next_yes && (t->next || t->next_no)) 164 if (t->chance>=100 && t->next_yes && (t->next || t->next_no))
165 LOG(llevError,"Treasurelist %s has element that has 100%% generation, next_yes field as well as next or next_no\n", 165 LOG(llevError,"Treasurelist %s has element that has 100%% generation, next_yes field as well as next or next_no\n",
220#endif 220#endif
221 tl->total_chance += t->chance; 221 tl->total_chance += t->chance;
222 } 222 }
223 } 223 }
224 } else 224 } else
225 LOG(llevError,"Treasure-list didn't understand: %s, line %d\n",buf, line); 225 LOG(llevError,"Treasure-list %s didn't understand: %s, line %d\n", filename, buf, line);
226 } 226 }
227 close_and_delete(fp, comp); 227 close_and_delete(fp, comp);
228 228
229#ifdef TREASURE_DEBUG 229#ifdef TREASURE_DEBUG
230 /* Perform some checks on how valid the treasure data actually is. 230 /* Perform some checks on how valid the treasure data actually is.
483/* calculate the appropriate level for wands staves and scrolls. If 483/* calculate the appropriate level for wands staves and scrolls. If
484 * retmult is 1, return the multiplier, not the level, for computing value 484 * retmult is 1, return the multiplier, not the level, for computing value
485 * This code presumes that op has had its spell object created (in op->inv) 485 * This code presumes that op has had its spell object created (in op->inv)
486 */ 486 */
487 487
488int level_for_item(object *op, int difficulty, int retmult) 488int level_for_item(const object *op, int difficulty, int retmult)
489{ 489{
490 int level, mult, olevel; 490 int level, mult, olevel;
491 491
492 mult = 0; 492 mult = 0;
493 if (!op->inv) { 493 if (!op->inv) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines