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

Comparing deliantra/server/common/utils.C (file contents):
Revision 1.28 by root, Sat Dec 23 16:05:19 2006 UTC vs.
Revision 1.31 by root, Mon Dec 25 14:54:44 2006 UTC

206 object *op, *otmp; 206 object *op, *otmp;
207 207
208 if (m->unique) 208 if (m->unique)
209 return; 209 return;
210 210
211 for (x = 0; x < MAP_WIDTH (m); x++) 211 for (x = 0; x < m->width; x++)
212 for (y = 0; y < MAP_HEIGHT (m); y++) 212 for (y = 0; y < m->height; y++)
213 for (op = GET_MAP_OB (m, x, y); op; op = otmp) 213 for (op = GET_MAP_OB (m, x, y); op; op = otmp)
214 { 214 {
215 destroy = 0; 215 destroy = 0;
216 otmp = op->above; 216 otmp = op->above;
217 if (QUERY_FLAG (op, FLAG_IS_FLOOR) && QUERY_FLAG (op, FLAG_UNIQUE)) 217 if (QUERY_FLAG (op, FLAG_IS_FLOOR) && QUERY_FLAG (op, FLAG_UNIQUE))
255 destroy = 1; 255 destroy = 1;
256 if ((op->material & M_STONE || op->material & M_ADAMANT) && rndm (1, 10) == 1) 256 if ((op->material & M_STONE || op->material & M_ADAMANT) && rndm (1, 10) == 1)
257 destroy = 1; 257 destroy = 1;
258 if ((op->material & M_SOFT_METAL || op->material & M_BONE) && rndm (1, 3) == 1) 258 if ((op->material & M_SOFT_METAL || op->material & M_BONE) && rndm (1, 3) == 1)
259 destroy = 1; 259 destroy = 1;
260 if (op->material & M_ICE && MAP_TEMP (m) > 32) 260 if (op->material & M_ICE && m->temp > 32)
261 destroy = 1; 261 destroy = 1;
262 } 262 }
263 /* adjust overall chance below */ 263 /* adjust overall chance below */
264 if (destroy && rndm (0, 1)) 264 if (destroy && rndm (0, 1))
265 op->destroy (); 265 op->destroy ();
544 return; 544 return;
545} 545}
546 546
547///////////////////////////////////////////////////////////////////////////// 547/////////////////////////////////////////////////////////////////////////////
548 548
549#if 0
550refcounted *refcounted::rc_first;
551
552refcounted::refcounted ()
553{
554 refcnt = 0;
555 rc_next = rc_first;
556 rc_first = this;
557}
558#endif
559
560refcounted::~refcounted ()
561{
562#if 0
563 assert (!rc_next);
564 assert (!refcnt);
565#endif
566}
567
568void *salloc_ (int n) throw (std::bad_alloc) 549void *salloc_ (int n) throw (std::bad_alloc)
569{ 550{
570 void *ptr = g_slice_alloc (n); 551 void *ptr = g_slice_alloc (n);
571 552
572 if (!ptr) 553 if (!ptr)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines