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

Comparing deliantra/server/random_maps/special.C (file contents):
Revision 1.29 by root, Fri May 2 21:01:53 2008 UTC vs.
Revision 1.30 by root, Fri May 2 21:22:22 2008 UTC

69 69
70/* copy in_map into dest_map at point x,y */ 70/* copy in_map into dest_map at point x,y */
71void 71void
72include_map_in_map (maptile *dest_map, maptile *in_map, int x, int y) 72include_map_in_map (maptile *dest_map, maptile *in_map, int x, int y)
73{ 73{
74 int i, j;
75 object *tmp;
76 object *new_ob;
77
78 /* First, splatter everything in the dest map at the location */ 74 /* First, splatter everything in the dest map at the location */
79 nuke_map_region (dest_map, x, y, in_map->width, in_map->height); 75 nuke_map_region (dest_map, x, y, in_map->width, in_map->height);
80 76
81 for (i = 0; i < in_map->width; i++) 77 for (int i = 0; i < in_map->width; i++)
82 for (j = 0; j < in_map->height; j++) 78 for (int j = 0; j < in_map->height; j++)
83 {
84 for (tmp = GET_MAP_OB (in_map, i, j); tmp != NULL; tmp = tmp->above) 79 for (object *tmp = GET_MAP_OB (in_map, i, j); tmp; tmp = tmp->above)
85 { 80 {
86 /* don't copy things with multiple squares: must be dealt with 81 /* don't copy things with multiple squares: must be dealt with
87 specially. */ 82 specially. */
88 if (tmp->head != NULL) 83 if (!tmp->is_head ())
89 continue; 84 continue;
90 new_ob = arch_to_object (tmp->arch); 85
91 copy_object_with_inv (tmp, new_ob); 86 object *new_ob = object_create_clone (tmp);
87
92 if (QUERY_FLAG (tmp, FLAG_IS_LINKED)) 88 if (QUERY_FLAG (tmp, FLAG_IS_LINKED))
93 add_button_link (new_ob, dest_map, tmp->path_attuned); 89 add_button_link (new_ob, dest_map, tmp->path_attuned);
90
94 new_ob->x = i + x; 91 new_ob->x = i + x;
95 new_ob->y = j + y; 92 new_ob->y = j + y;
96 insert_multisquare_ob_in_map (new_ob, dest_map); 93 insert_ob_in_map (new_ob, dest_map, 0, INS_NO_MERGE | INS_NO_WALK_ON);
97 } 94 }
98 }
99} 95}
100 96
101int 97int
102find_spot_for_submap (maptile *map, char **layout, int *ix, int *iy, int xsize, int ysize) 98find_spot_for_submap (maptile *map, char **layout, int *ix, int *iy, int xsize, int ysize)
103{ 99{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines