… | |
… | |
99 | while ((tmp = generate_treasure (op->randomitems, op->stats.exp ? op->stats.exp : 5)) == NULL && --i); |
99 | while ((tmp = generate_treasure (op->randomitems, op->stats.exp ? op->stats.exp : 5)) == NULL && --i); |
100 | if (tmp == NULL) |
100 | if (tmp == NULL) |
101 | return 0; |
101 | return 0; |
102 | if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) |
102 | if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) |
103 | { |
103 | { |
104 | tmp->destroy (0); |
104 | tmp->destroy (); |
105 | tmp = NULL; |
105 | tmp = NULL; |
106 | } |
106 | } |
107 | } |
107 | } |
108 | while (!tmp); |
108 | while (!tmp); |
109 | |
109 | |
… | |
… | |
118 | if (HAS_RANDOM_ITEMS (op)) |
118 | if (HAS_RANDOM_ITEMS (op)) |
119 | while ((op->stats.hp--) > 0) |
119 | while ((op->stats.hp--) > 0) |
120 | create_treasure (op->randomitems, op, GT_ENVIRONMENT, |
120 | create_treasure (op->randomitems, op, GT_ENVIRONMENT, |
121 | op->stats.exp ? op->stats.exp : op->map == NULL ? 14 : op->map->difficulty, 0); |
121 | op->stats.exp ? op->stats.exp : op->map == NULL ? 14 : op->map->difficulty, 0); |
122 | op->remove (); |
122 | op->remove (); |
123 | op->destroy (0); |
123 | op->destroy (); |
124 | break; |
124 | break; |
125 | } |
125 | } |
126 | |
126 | |
127 | return tmp ? 1 : 0; |
127 | return tmp ? 1 : 0; |
128 | } |
128 | } |