ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/standalone.C
(Generate patch)

Comparing deliantra/server/random_maps/standalone.C (file contents):
Revision 1.7 by root, Tue Dec 12 21:39:56 2006 UTC vs.
Revision 1.8 by root, Mon Dec 18 03:00:02 2006 UTC

89 int i; 89 int i;
90 90
91 switch (op->type) 91 switch (op->type)
92 { 92 {
93 case SHOP_FLOOR: 93 case SHOP_FLOOR:
94 if (!HAS_RANDOM_ITEMS (op)) 94 if (!op->has_random_items ())
95 return 0; 95 return 0;
96 do 96 do
97 { 97 {
98 i = 10; /* let's give it 10 tries */ 98 i = 10; /* let's give it 10 tries */
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);
113 CLEAR_FLAG (op, FLAG_AUTO_APPLY); 113 CLEAR_FLAG (op, FLAG_AUTO_APPLY);
114 identify (tmp); 114 identify (tmp);
115 break; 115 break;
116 116
117 case TREASURE: 117 case TREASURE:
118 if (HAS_RANDOM_ITEMS (op)) 118 if (op->has_random_items ())
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 (); 123 op->destroy ();
147 147
148 if (QUERY_FLAG (tmp, FLAG_AUTO_APPLY)) 148 if (QUERY_FLAG (tmp, FLAG_AUTO_APPLY))
149 auto_apply (tmp); 149 auto_apply (tmp);
150 else if (tmp->type == TREASURE) 150 else if (tmp->type == TREASURE)
151 { 151 {
152 if (HAS_RANDOM_ITEMS (tmp)) 152 if (tmp->has_random_items ())
153 while ((tmp->stats.hp--) > 0) 153 while ((tmp->stats.hp--) > 0)
154 create_treasure (tmp->randomitems, tmp, 0, m->difficulty, 0); 154 create_treasure (tmp->randomitems, tmp, 0, m->difficulty, 0);
155 } 155 }
156 if (tmp && tmp->arch && tmp->type != PLAYER && tmp->type != TREASURE && tmp->randomitems) 156 if (tmp && tmp->arch && tmp->type != PLAYER && tmp->type != TREASURE && tmp->randomitems)
157 { 157 {
158 if (tmp->type == CONTAINER) 158 if (tmp->type == CONTAINER)
159 { 159 {
160 if (HAS_RANDOM_ITEMS (tmp)) 160 if (tmp->has_random_items ())
161 while ((tmp->stats.hp--) > 0) 161 while ((tmp->stats.hp--) > 0)
162 create_treasure (tmp->randomitems, tmp, 0, m->difficulty, 0); 162 create_treasure (tmp->randomitems, tmp, 0, m->difficulty, 0);
163 } 163 }
164 else if (HAS_RANDOM_ITEMS (tmp)) 164 else if (tmp->has_random_items ())
165 create_treasure (tmp->randomitems, tmp, GT_APPLY, m->difficulty, 0); 165 create_treasure (tmp->randomitems, tmp, GT_APPLY, m->difficulty, 0);
166 } 166 }
167 } 167 }
168 for (x = 0; x < MAP_WIDTH (m); x++) 168 for (x = 0; x < MAP_WIDTH (m); x++)
169 for (y = 0; y < MAP_HEIGHT (m); y++) 169 for (y = 0; y < MAP_HEIGHT (m); y++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines