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.17 by root, Fri Apr 11 21:09:53 2008 UTC vs.
Revision 1.18 by root, Mon Sep 29 09:04:51 2008 UTC

94 if (!op->has_random_items ()) 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
99 while ((tmp = generate_treasure (op->randomitems, op->stats.exp ? op->stats.exp : 5)) == NULL && --i); 100 while (!(tmp = generate_treasure (op->randomitems, op->stats.exp ? op->stats.exp : 5))
101 && --i)
102 ;
103
100 if (tmp == NULL) 104 if (tmp == NULL)
101 return 0; 105 return 0;
106
102 if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) 107 if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED))
103 { 108 {
104 tmp->destroy (); 109 tmp->destroy (true);
105 tmp = NULL; 110 tmp = NULL;
106 } 111 }
107 } 112 }
108 while (!tmp); 113 while (!tmp);
109 114
117 case TREASURE: 122 case TREASURE:
118 if (op->has_random_items ()) 123 if (op->has_random_items ())
119 while ((op->stats.hp--) > 0) 124 while ((op->stats.hp--) > 0)
120 create_treasure (op->randomitems, op, GT_ENVIRONMENT, 125 create_treasure (op->randomitems, op, GT_ENVIRONMENT,
121 op->stats.exp ? op->stats.exp : op->map == NULL ? 14 : op->map->difficulty, 0); 126 op->stats.exp ? op->stats.exp : op->map == NULL ? 14 : op->map->difficulty, 0);
122 op->remove (); 127
123 op->destroy (); 128 op->destroy (true);
124 break; 129 break;
125 } 130 }
126 131
127 return tmp ? 1 : 0; 132 return tmp ? 1 : 0;
128} 133}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines