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.81 by root, Mon Sep 29 10:31:32 2008 UTC vs.
Revision 1.84 by root, Thu Jan 1 11:41:17 2009 UTC

248 * by another object. 248 * by another object.
249 */ 249 */
250 //TODO: flag such as objects... as such (no drop, anybody?) 250 //TODO: flag such as objects... as such (no drop, anybody?)
251 if (op->type == SPELL) 251 if (op->type == SPELL)
252 { 252 {
253 op->destroy (true); 253 op->destroy ();
254 return; 254 return;
255 } 255 }
256 256
257 op->expand_tail (); 257 op->expand_tail ();
258 258
259 if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y)) 259 if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y))
260 op->destroy (true); 260 op->destroy ();
261 else 261 else
262 { 262 {
263 SET_FLAG (op, FLAG_OBJ_ORIGINAL); 263 SET_FLAG (op, FLAG_OBJ_ORIGINAL);
264 op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON); 264 op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON);
265 } 265 }
440 tmp->remove (); 440 tmp->remove ();
441 441
442 if (ob->inv) 442 if (ob->inv)
443 LOG (llevError, "In generate treasure, created multiple objects.\n"); 443 LOG (llevError, "In generate treasure, created multiple objects.\n");
444 444
445 ob->destroy (true); 445 ob->destroy ();
446 446
447 return tmp; 447 return tmp;
448} 448}
449 449
450/* 450/*
1566#if 1 1566#if 1
1567 LOG (llevError, "Got null entry and non zero roll in generate_artifact, type %d\n", op->type); 1567 LOG (llevError, "Got null entry and non zero roll in generate_artifact, type %d\n", op->type);
1568#endif 1568#endif
1569 return; 1569 return;
1570 } 1570 }
1571 if (!strcmp (art->item->name, "NONE")) 1571
1572 if (art->item->name == shstr_NONE)
1572 return; 1573 return;
1574
1573 if (FABS (op->magic) < art->item->magic) 1575 if (fabs (op->magic) < art->item->magic)
1574 continue; /* Not magic enough to be this item */ 1576 continue; /* Not magic enough to be this item */
1575 1577
1576 /* Map difficulty not high enough */ 1578 /* Map difficulty not high enough */
1577 if (difficulty < art->difficulty) 1579 if (difficulty < art->difficulty)
1578 continue; 1580 continue;
1629 item->level = donor->level; 1631 item->level = donor->level;
1630 1632
1631 /* if donor has some attacktypes, the flesh is poisonous */ 1633 /* if donor has some attacktypes, the flesh is poisonous */
1632 if (donor->attacktype & AT_POISON) 1634 if (donor->attacktype & AT_POISON)
1633 item->type = POISON; 1635 item->type = POISON;
1636
1634 if (donor->attacktype & AT_ACID) 1637 if (donor->attacktype & AT_ACID)
1635 item->stats.hp = -1 * item->stats.food; 1638 item->stats.hp = -1 * item->stats.food;
1639
1636 SET_FLAG (item, FLAG_NO_STEAL); 1640 SET_FLAG (item, FLAG_NO_STEAL);
1637 } 1641 }
1638} 1642}
1639 1643
1640/* special_potion() - so that old potion code is still done right. */ 1644/* special_potion() - so that old potion code is still done right. */
1677free_artifact (artifact *at) 1681free_artifact (artifact *at)
1678{ 1682{
1679 if (at->next) free_artifact (at->next); 1683 if (at->next) free_artifact (at->next);
1680 if (at->allowed) free_charlinks (at->allowed); 1684 if (at->allowed) free_charlinks (at->allowed);
1681 1685
1682 at->item->destroy (true); 1686 at->item->destroy ();
1683 1687
1684 sfree (at); 1688 sfree (at);
1685} 1689}
1686 1690
1687void 1691void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines