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.110 by root, Sun Jul 1 05:00:17 2007 UTC vs.
Revision 1.113 by root, Fri Jul 13 15:54:40 2007 UTC

355{ 355{
356 if (!spaces) 356 if (!spaces)
357 return; 357 return;
358 358
359 for (mapspace *ms = spaces + size (); ms-- > spaces; ) 359 for (mapspace *ms = spaces + size (); ms-- > spaces; )
360 for (object *op = ms->bot; op; op = op->above) 360 {
361 object *op = ms->bot;
362 while (op)
361 { 363 {
362 /* already multipart - don't do anything more */ 364 /* already multipart - don't do anything more */
363 if (op->head_ () == op && !op->more && op->arch->more) 365 if (op->head_ () == op && !op->more && op->arch->more)
364 { 366 {
365 op->remove (); 367 op->remove ();
366 op->expand_tail (); 368 op->expand_tail ();
369
370 // FIXME: INS_ON_TOP is just a workaround for the pentagram vs.
371 // multi-tile monster bug, where INS_ABOVE_FLOOR_ONLY put the monsters
372 // below the pentagrams... hopefully INS_ON_TOP doesn't break anything
367 insert (op, op->x, op->y, 0, INS_NO_MERGE | INS_ABOVE_FLOOR_ONLY | INS_NO_WALK_ON); 373 insert (op, op->x, op->y, 0, INS_NO_MERGE | INS_ON_TOP | INS_NO_WALK_ON);
374
375 op = ms->bot; // we are mutating the mapspace too much with INS_ON_TOP
376 // so we have to reset the iteration through the mapspace
368 } 377 }
378 else
379 op = op->above;
369 } 380 }
381 }
370} 382}
371 383
372/* 384/*
373 * Loads (ands parses) the objects into a given map from the specified 385 * Loads (ands parses) the objects into a given map from the specified
374 * file pointer. 386 * file pointer.
734 case KW_tile_path_1: thawer.get (tile_path [0]); break; 746 case KW_tile_path_1: thawer.get (tile_path [0]); break;
735 case KW_tile_path_2: thawer.get (tile_path [1]); break; 747 case KW_tile_path_2: thawer.get (tile_path [1]); break;
736 case KW_tile_path_3: thawer.get (tile_path [2]); break; 748 case KW_tile_path_3: thawer.get (tile_path [2]); break;
737 case KW_tile_path_4: thawer.get (tile_path [3]); break; 749 case KW_tile_path_4: thawer.get (tile_path [3]); break;
738 750
751 case KW_ERROR:
752 set_key (thawer.kw_str, thawer.value);
753 break;
754
739 case KW_end: 755 case KW_end:
740 return true; 756 return true;
741 757
742 default: 758 default:
743 if (!thawer.parse_error ("map", 0)) 759 if (!thawer.parse_error ("map", 0))
864 * Remove and free all objects in the given map. 880 * Remove and free all objects in the given map.
865 */ 881 */
866void 882void
867maptile::clear () 883maptile::clear ()
868{ 884{
869 sfree (regions, size ()), regions = 0; 885 sfree (regions, size ()); regions = 0;
870 free (regionmap), regionmap = 0; 886 delete [] regionmap; regionmap = 0;
871 887
872 if (spaces) 888 if (spaces)
873 { 889 {
874 for (mapspace *ms = spaces + size (); ms-- > spaces; ) 890 for (mapspace *ms = spaces + size (); ms-- > spaces; )
875 while (object *op = ms->bot) 891 while (object *op = ms->bot)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines