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.36 by root, Wed Feb 7 02:04:46 2007 UTC vs.
Revision 1.37 by root, Thu Feb 8 03:09:31 2007 UTC

433 * to do that. 433 * to do that.
434 */ 434 */
435void 435void
436create_treasure (treasurelist *tl, object *op, int flag, int difficulty, int tries) 436create_treasure (treasurelist *tl, object *op, int flag, int difficulty, int tries)
437{ 437{
438
439 if (tries++ > 100) 438 if (tries++ > 100)
440 { 439 {
441 LOG (llevDebug, "createtreasure: tries exceeded 100, returning without making treasure\n"); 440 LOG (llevDebug, "createtreasure: tries exceeded 100, returning without making treasure\n");
442 return; 441 return;
443 } 442 }
443
444 if (tl->total_chance) 444 if (tl->total_chance)
445 create_one_treasure (tl, op, flag, difficulty, tries); 445 create_one_treasure (tl, op, flag, difficulty, tries);
446 else 446 else
447 create_all_treasures (tl->items, op, flag, difficulty, tries); 447 create_all_treasures (tl->items, op, flag, difficulty, tries);
448} 448}
1401 } 1401 }
1402 else if (sscanf (cp, "chance %d", &value)) 1402 else if (sscanf (cp, "chance %d", &value))
1403 art->chance = (uint16) value; 1403 art->chance = (uint16) value;
1404 else if (sscanf (cp, "difficulty %d", &value)) 1404 else if (sscanf (cp, "difficulty %d", &value))
1405 art->difficulty = (uint8) value; 1405 art->difficulty = (uint8) value;
1406 else if (!strncmp (cp, "Object", 6)) 1406 else if (!strncmp (cp, "Object", 6) || !strncmp (cp, "object", 6))
1407 { 1407 {
1408 art->item = object::create (); 1408 art->item = object::create ();
1409 1409
1410 if (!load_object (thawer, art->item, 0)) 1410 if (!load_object (thawer, art->item, 0))
1411 LOG (llevError, "Init_Artifacts: Could not load object.\n"); 1411 LOG (llevError, "Init_Artifacts: Could not load object.\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines