… | |
… | |
45 | typedef std::tr1::unordered_map< |
45 | typedef std::tr1::unordered_map< |
46 | const char *, |
46 | const char *, |
47 | treasurelist *, |
47 | treasurelist *, |
48 | str_hash, |
48 | str_hash, |
49 | str_equal, |
49 | str_equal, |
50 | slice_allocator< std::pair<const char *const, treasurelist *> >, |
50 | slice_allocator< std::pair<const char *const, treasurelist *> > |
51 | true |
|
|
52 | > tl_map_t; |
51 | > tl_map_t; |
53 | |
52 | |
54 | static tl_map_t tl_map; |
53 | static tl_map_t tl_map; |
55 | |
54 | |
56 | /* |
55 | /* |
… | |
… | |
255 | return; |
254 | return; |
256 | } |
255 | } |
257 | |
256 | |
258 | op->expand_tail (); |
257 | op->expand_tail (); |
259 | |
258 | |
260 | if (op->blocked (creator->map, creator->x, creator->y)) |
259 | if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y)) |
261 | op->destroy (); |
260 | op->destroy (); |
262 | else |
261 | else |
263 | { |
262 | { |
264 | SET_FLAG (op, FLAG_OBJ_ORIGINAL); |
263 | SET_FLAG (op, FLAG_OBJ_ORIGINAL); |
265 | 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); |
… | |
… | |
578 | if (op->type == ARMOUR) |
577 | if (op->type == ARMOUR) |
579 | ARMOUR_SPEED (op) = (ARMOUR_SPEED (op->arch) * (100 + magic * 10)) / 100; |
578 | ARMOUR_SPEED (op) = (ARMOUR_SPEED (op->arch) * (100 + magic * 10)) / 100; |
580 | |
579 | |
581 | if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */ |
580 | if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */ |
582 | magic = (-magic); |
581 | magic = (-magic); |
|
|
582 | |
583 | op->weight = (op->arch->weight * (100 - magic * 10)) / 100; |
583 | op->weight = (op->arch->weight * (100 - magic * 10)) / 100; |
584 | } |
584 | } |
585 | else |
585 | else |
586 | { |
586 | { |
587 | if (op->type == ARMOUR) |
587 | if (op->type == ARMOUR) |
588 | ARMOUR_SPEED (op) = (ARMOUR_SPEED (op) * (100 + magic * 10)) / 100; |
588 | ARMOUR_SPEED (op) = (ARMOUR_SPEED (op) * (100 + magic * 10)) / 100; |
|
|
589 | |
589 | if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */ |
590 | if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */ |
590 | magic = (-magic); |
591 | magic = (-magic); |
|
|
592 | |
591 | op->weight = (op->weight * (100 - magic * 10)) / 100; |
593 | op->weight = (op->weight * (100 - magic * 10)) / 100; |
592 | } |
594 | } |
593 | } |
595 | } |
594 | |
596 | |
595 | /* |
597 | /* |