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

Comparing deliantra/server/common/map.C (file contents):
Revision 1.119 by root, Fri Aug 24 00:53:54 2007 UTC vs.
Revision 1.121 by root, Sat Aug 25 22:19:26 2007 UTC

383 if (!spaces) 383 if (!spaces)
384 return false; 384 return false;
385 385
386 for (int i = 0; i < size (); ++i) 386 for (int i = 0; i < size (); ++i)
387 { 387 {
388 int unique = 0; 388 bool unique = 0;
389
389 for (object *op = spaces [i].bot; op; op = op->above) 390 for (object *op = spaces [i].bot; op; op = op->above)
390 { 391 {
391 if (op->flag [FLAG_UNIQUE] && op->flag [FLAG_IS_FLOOR]) 392 unique |= op->flag [FLAG_UNIQUE] && op->flag [FLAG_IS_FLOOR];
392 unique = 1;
393 393
394 if (!op->can_map_save ()) 394 if (expect_false (!op->can_map_save ()))
395 continue; 395 continue;
396 396
397 if (unique || op->flag [FLAG_UNIQUE]) 397 if (expect_false (unique || op->flag [FLAG_UNIQUE]))
398 { 398 {
399 if (flags & IO_UNIQUES) 399 if (flags & IO_UNIQUES)
400 op->write (f); 400 op->write (f);
401 } 401 }
402 else if (flags & IO_OBJECTS) 402 else if (expect_true (flags & IO_OBJECTS))
403 op->write (f); 403 op->write (f);
404 } 404 }
405 } 405 }
406 406
407 coroapi::cede_to_tick (); 407 coroapi::cede_to_tick ();
1358adjacent_map (const maptile *map1, const maptile *map2, int *dx, int *dy) 1358adjacent_map (const maptile *map1, const maptile *map2, int *dx, int *dy)
1359{ 1359{
1360 if (!map1 || !map2) 1360 if (!map1 || !map2)
1361 return 0; 1361 return 0;
1362 1362
1363 //TODO: this doesn't actually check corretcly when intermediate maps are not loaded 1363 //TODO: this doesn't actually check correctly when intermediate maps are not loaded
1364 //fix: compare paths instead (this is likely faster, too!) 1364 //fix: compare paths instead (this is likely faster, too!)
1365 if (map1 == map2) 1365 if (map1 == map2)
1366 { 1366 {
1367 *dx = 0; 1367 *dx = 0;
1368 *dy = 0; 1368 *dy = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines