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.50 by root, Mon Dec 25 15:28:35 2006 UTC vs.
Revision 1.51 by root, Mon Dec 25 17:11:16 2006 UTC

601 * Modified by MSW 2001-07-01 to do in a single pass - reduces code, 601 * Modified by MSW 2001-07-01 to do in a single pass - reduces code,
602 * and we only save the head of multi part objects - this is needed 602 * and we only save the head of multi part objects - this is needed
603 * in order to do map tiling properly. 603 * in order to do map tiling properly.
604 */ 604 */
605void 605void
606save_objects (maptile *m, object_freezer & fp, object_freezer & fp2, int flag) 606save_objects (maptile *m, object_freezer &fp, object_freezer &fp2, int flag)
607{ 607{
608 int i, j = 0, unique = 0; 608 int i, j = 0, unique = 0;
609 object *op; 609 object *op;
610 610
611 /* first pass - save one-part objects */ 611 /* first pass - save one-part objects */
612 for (i = 0; i < m->width; i++) 612 for (i = 0; i < m->width; i++)
613 for (j = 0; j < m->height; j++) 613 for (j = 0; j < m->height; j++)
614 { 614 {
615 unique = 0; 615 unique = 0;
616
616 for (op = m->at (i, j).bot; op; op = op->above) 617 for (op = m->at (i, j).bot; op; op = op->above)
617 { 618 {
618 if (op->flag [FLAG_IS_FLOOR] && op->flag [FLAG_UNIQUE]) 619 if (op->flag [FLAG_UNIQUE] && op->flag [FLAG_IS_FLOOR])
619 unique = 1; 620 unique = 1;
620 621
621 if (op->type == PLAYER) 622 if (op->type == PLAYER)
622 continue; 623 continue;
623 624
624 if (op->head || op->owner) 625 if (op->head || op->owner)
625 continue; 626 continue;
626 627
627 if (unique || op->flag [FLAG_UNIQUE]) 628 if (unique || op->flag [FLAG_UNIQUE])
628 save_object (fp2, op, 3); 629 save_object (fp2, op, 1);
629 else if (flag == 0 || (flag == 2 && (!op->flag [FLAG_OBJ_ORIGINAL] && !op->flag [FLAG_UNPAID]))) 630 else if (flag == 0 || (flag == 2 && (!op->flag [FLAG_OBJ_ORIGINAL] && !op->flag [FLAG_UNPAID])))
630 save_object (fp, op, 3); 631 save_object (fp, op, 1);
631 } 632 }
632 } 633 }
633} 634}
634 635
635maptile::maptile () 636maptile::maptile ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines