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

Comparing deliantra/server/random_maps/wall.C (file contents):
Revision 1.1 by elmex, Sun Aug 13 17:16:03 2006 UTC vs.
Revision 1.31 by root, Fri Nov 6 13:03:34 2009 UTC

1/* 1/*
2 * static char *rcsid_wall_c = 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * "$Id: wall.C,v 1.1 2006/08/13 17:16:03 elmex Exp $"; 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the Affero GNU General Public License
19 * and the GNU General Public License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
21 *
22 * The authors can be reached via e-mail to <support@deliantra.net>
4 */ 23 */
5
6/*
7 CrossFire, A Multiplayer game for X-windows
8
9 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
10 Copyright (C) 1992 Frank Tore Johansen
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
26 The authors can be reached via e-mail at crossfire-devel@real-time.com
27*/
28 24
29#include <global.h> 25#include <global.h>
30#include <random_map.h> 26#include <random_map.h>
31#include <rproto.h> 27#include <rproto.h>
32 28
33/* Put in the walls and autojoin them. */ 29/* Put in the walls and autojoin them. */
34 30
35
36/* given a layout and a coordinate, tell me which squares up/down/right/left 31/* given a layout and a coordinate, tell me which squares up/down/right/left
37 are occupied. */ 32 are occupied. */
38 33int
39int surround_flag(char **layout,int i,int j,RMParms *RP){ 34surround_flag (char **layout, int i, int j, random_map_params *RP)
35{
40 /* 1 = wall to left, 36 /* 1 = wall to left,
41 2 = wall to right, 37 2 = wall to right,
42 4 = wall above 38 4 = wall above
43 8 = wall below */ 39 8 = wall below */
40 int surround_index = 0;
41
42 if ((i > 0) && layout[i - 1][j] != 0)
44 int surround_index = 0; 43 surround_index |= 1;
45 if((i > 0) && layout[i-1][j]!=0) surround_index |=1;
46 if((i < RP->Xsize-1) && layout[i+1][j]!=0) surround_index |=2; 44 if ((i < RP->Xsize - 1) && layout[i + 1][j] != 0)
47 if((j > 0) && layout[i][j-1]!=0) surround_index |=4; 45 surround_index |= 2;
46 if ((j > 0) && layout[i][j - 1] != 0)
47 surround_index |= 4;
48 if((j < RP->Ysize-1) && layout[i][j+1]!=0) surround_index |=8; 48 if ((j < RP->Ysize - 1) && layout[i][j + 1] != 0)
49 surround_index |= 8;
49 return surround_index; 50 return surround_index;
50} 51}
51 52
52 53
53/* like surround_flag, but only walls count. 54/* like surround_flag, but only walls count.
54 */ 55 */
55 56
57int
56int surround_flag2(char **layout,int i,int j,RMParms *RP){ 58surround_flag2 (char **layout, int i, int j, random_map_params *RP)
59{
57 /* 1 = wall to left, 60 /* 1 = wall to left,
58 2 = wall to right, 61 2 = wall to right,
59 4 = wall above 62 4 = wall above
60 8 = wall below */ 63 8 = wall below */
64 int surround_index = 0;
65
66 if ((i > 0) && layout[i - 1][j] == '#')
61 int surround_index = 0; 67 surround_index |= 1;
62 if((i > 0) && layout[i-1][j]=='#') surround_index |=1;
63 if((i < RP->Xsize-1) && layout[i+1][j]=='#') surround_index |=2; 68 if ((i < RP->Xsize - 1) && layout[i + 1][j] == '#')
64 if((j > 0) && layout[i][j-1]=='#') surround_index |=4; 69 surround_index |= 2;
70 if ((j > 0) && layout[i][j - 1] == '#')
71 surround_index |= 4;
65 if((j < RP->Ysize-1) && layout[i][j+1]=='#') surround_index |=8; 72 if ((j < RP->Ysize - 1) && layout[i][j + 1] == '#')
73 surround_index |= 8;
66 return surround_index; 74 return surround_index;
67} 75}
68 76
69 77
70/* like surround_flag, except it checks a map, not a layout. 78/* like surround_flag, except it checks a map, not a layout.
71 * Since this is part of the random map code, presumption 79 * Since this is part of the random map code, presumption
72 * is that this is not a tiled map. 80 * is that this is not a tiled map.
73 * What is considered blocking and not is somewhat hard coded. 81 * What is considered blocking and not is somewhat hard coded.
74 */ 82 */
83int
75int surround_flag3(mapstruct *map,sint16 i,sint16 j,RMParms *RP){ 84surround_flag3 (maptile *map, sint16 i, sint16 j, random_map_params *RP)
85{
76 /* 86 /*
77 * 1 = blocked to left, 87 * 1 = blocked to left,
78 * 2 = blocked to right, 88 * 2 = blocked to right,
79 * 4 = blocked above 89 * 4 = blocked above
80 * 8 = blocked below 90 * 8 = blocked below
81 */ 91 */
82 92
83 int surround_index = 0; 93 int surround_index = 0;
84 94
95 // don't forget to update the mapspace!
96 if (i > 0) map->at (i - 1, j ).update ();
97 if (i < RP->Xsize - 1) map->at (i + 1, j ).update ();
98 if (j > 0) map->at (i , j - 1).update ();
99 if (j < RP->Ysize - 1) map->at (i , j + 1).update ();
100
85 if((i > 0) && (GET_MAP_MOVE_BLOCK(map, i-1,j) & ~MOVE_BLOCK_DEFAULT)) 101 if ((i > 0) && (GET_MAP_MOVE_BLOCK (map, i - 1, j) & MOVE_WALK))
86 surround_index |=1; 102 surround_index |= 1;
87 if((i < RP->Xsize-1) && (GET_MAP_MOVE_BLOCK(map, i+1,j) & ~MOVE_BLOCK_DEFAULT)) 103 if ((i < RP->Xsize - 1) && (GET_MAP_MOVE_BLOCK (map, i + 1, j) & MOVE_WALK))
88 surround_index |=2; 104 surround_index |= 2;
89 if((j > 0) && (GET_MAP_MOVE_BLOCK(map, i,j-1) & ~MOVE_BLOCK_DEFAULT)) 105 if ((j > 0) && (GET_MAP_MOVE_BLOCK (map, i, j - 1) & MOVE_WALK))
90 surround_index |=4; 106 surround_index |= 4;
91 if((j < RP->Ysize-1) && (GET_MAP_MOVE_BLOCK(map,i,j+1) & ~MOVE_BLOCK_DEFAULT)) 107 if ((j < RP->Ysize - 1) && (GET_MAP_MOVE_BLOCK (map, i, j + 1) & MOVE_WALK))
92 surround_index |=8; 108 surround_index |= 8;
93 109
94 return surround_index; 110 return surround_index;
95} 111}
96 112
97/* like surround_flag2, except it checks a map, not a layout. */ 113/* like surround_flag2, except it checks a map, not a layout. */
98 114static int
99int surround_flag4(mapstruct *map,int i,int j,RMParms *RP){ 115surround_flag4 (maptile *map, int i, int j, random_map_params *RP)
116{
100 /* 1 = blocked to left, 117 /* 1 = blocked to left,
101 2 = blocked to right, 118 2 = blocked to right,
102 4 = blocked above 119 4 = blocked above
103 8 = blocked below */ 120 8 = blocked below */
121 int surround_index = 0;
122
123 if ((i > 0) && wall_blocked (map, i - 1, j))
104 int surround_index = 0; 124 surround_index |= 1;
105
106 if((i > 0) && wall_blocked(map,i-1,j)) surround_index |=1;
107 if((i < RP->Xsize-1) && wall_blocked(map,i+1,j)) surround_index |=2; 125 if ((i < RP->Xsize - 1) && wall_blocked (map, i + 1, j))
126 surround_index |= 2;
108 if((j > 0) && wall_blocked(map,i,j-1)) surround_index |=4; 127 if ((j > 0) && wall_blocked (map, i, j - 1))
128 surround_index |= 4;
109 if((j < RP->Ysize-1) && wall_blocked(map,i,j+1)) surround_index |=8; 129 if ((j < RP->Ysize - 1) && wall_blocked (map, i, j + 1))
130 surround_index |= 8;
110 131
111 return surround_index; 132 return surround_index;
112} 133}
113 134
135/* picks the right wall type for this square, to make it look nice,
136 and have everything nicely joined. It uses the layout. */
137static object *
138pick_joined_wall (object *the_wall, char **layout, int i, int j, random_map_params *RP)
139{
140 /* 1 = wall to left,
141 2 = wall to right,
142 4 = wall above
143 8 = wall below */
144 int surround_index = 0;
145 int l;
146 char wall_name[1024];
147 archetype *wall_arch = 0;
148
149 assign (wall_name, the_wall->arch->archname);
150
151 /* conventionally, walls are named like this:
152 wallname_wallcode, where wallcode indicates
153 a joinedness, and wallname is the wall.
154 this code depends on the convention for
155 finding the right wall. */
156
157 /* extract the wall name, which is the text up to the leading _ */
158 for (l = 0; l < 64; l++)
159 {
160 if (wall_name[l] == '_')
161 {
162 wall_name[l] = 0;
163 break;
164 }
165 }
166
167 surround_index = surround_flag2 (layout, i, j, RP);
168
169 switch (surround_index)
170 {
171 case 0:
172 strcat (wall_name, "_0");
173 break;
174 case 1:
175 strcat (wall_name, "_1_3");
176 break;
177 case 2:
178 strcat (wall_name, "_1_4");
179 break;
180 case 3:
181 strcat (wall_name, "_2_1_2");
182 break;
183 case 4:
184 strcat (wall_name, "_1_2");
185 break;
186 case 5:
187 strcat (wall_name, "_2_2_4");
188 break;
189 case 6:
190 strcat (wall_name, "_2_2_1");
191 break;
192 case 7:
193 strcat (wall_name, "_3_1");
194 break;
195 case 8:
196 strcat (wall_name, "_1_1");
197 break;
198 case 9:
199 strcat (wall_name, "_2_2_3");
200 break;
201 case 10:
202 strcat (wall_name, "_2_2_2");
203 break;
204 case 11:
205 strcat (wall_name, "_3_3");
206 break;
207 case 12:
208 strcat (wall_name, "_2_1_1");
209 break;
210 case 13:
211 strcat (wall_name, "_3_4");
212 break;
213 case 14:
214 strcat (wall_name, "_3_2");
215 break;
216 case 15:
217 strcat (wall_name, "_4");
218 break;
219 }
220 wall_arch = archetype::find (wall_name);
221
222 return wall_arch ? arch_to_object (wall_arch) : arch_to_object (the_wall->arch);
223}
224
114/* takes a map and a layout, and puts walls in the map (picked from 225/* takes a map and a layout, and puts walls in the map (picked from
115 w_style) at '#' marks. */ 226 w_style) at '#' marks. */
116 227void
117void make_map_walls(mapstruct *map,char **layout, char *w_style,RMParms *RP) { 228make_map_walls (maptile *map, char **layout, char *w_style, random_map_params *RP)
229{
118 char styledirname[256]; 230 char styledirname[1024];
119 char stylefilepath[256]; 231 char stylefilepath[1024];
120 mapstruct *style_map=0; 232 maptile *style_map = 0;
121 object *the_wall; 233 object *the_wall;
122 234
123 /* get the style map */ 235 /* get the style map */
124 if(!strcmp(w_style,"none")) return; 236 if (!strcmp (w_style, "none"))
237 return;
125 sprintf(styledirname,"%s","/styles/wallstyles"); 238 sprintf (styledirname, "%s", "/styles/wallstyles");
126 sprintf(stylefilepath,"%s/%s",styledirname,w_style); 239 sprintf (stylefilepath, "%s/%s", styledirname, w_style);
127 style_map = find_style(styledirname,w_style,-1); 240 style_map = find_style (styledirname, w_style, -1);
128 if(style_map == 0) return; 241 if (!style_map)
242 return;
129 243
130 /* fill up the map with the given floor style */ 244 /* fill up the map with the given floor style */
131 if((the_wall=pick_random_object(style_map))!=NULL) { 245 if ((the_wall = style_map->pick_random_object (rmg_rndm)))
132 int i,j; 246 {
133 char *cp; 247 int i, j;
248 char *cp;
134 int joinedwalls=0; 249 int joinedwalls = 0;
135 object *thiswall; 250 object *thiswall;
136 251
137 sprintf(RP->wall_name,"%s",the_wall->arch->name); 252 sprintf (RP->wall_name, "%s", &the_wall->arch->archname);
138 if ((cp=strchr(RP->wall_name,'_'))!=NULL) { 253 if ((cp = strchr (RP->wall_name, '_')) != NULL)
139 *cp=0; 254 {
140 joinedwalls=1; 255 *cp = 0;
141 } 256 joinedwalls = 1;
257 }
142 258
143 for(i=0;i<RP->Xsize;i++) 259 for (i = 0; i < RP->Xsize; i++)
144 for(j=0;j<RP->Ysize;j++) { 260 for (j = 0; j < RP->Ysize; j++)
145 if(layout[i][j]=='#') { 261 {
146 if(joinedwalls) 262 if (layout[i][j] == '#')
263 {
264 if (joinedwalls)
147 thiswall=pick_joined_wall(the_wall,layout,i,j,RP); 265 thiswall = pick_joined_wall (the_wall, layout, i, j, RP);
148 else 266 else
149 thiswall=arch_to_object(the_wall->arch); 267 thiswall = arch_to_object (the_wall->arch);
150 thiswall->x = i; 268
151 thiswall->y = j; 269 thiswall->x = i;
270 thiswall->y = j;
152 thiswall->move_block = MOVE_ALL; 271 thiswall->move_block = MOVE_ALL;
153 insert_ob_in_map(thiswall,map,thiswall,INS_NO_MERGE | INS_NO_WALK_ON); 272 insert_ob_in_map (thiswall, map, thiswall, INS_NO_MERGE | INS_NO_WALK_ON);
154 } 273 }
274 }
155 } 275 }
156 }
157} 276}
158
159
160/* picks the right wall type for this square, to make it look nice,
161 and have everything nicely joined. It uses the layout. */
162
163object *pick_joined_wall(object *the_wall,char **layout,int i,int j,RMParms *RP) {
164 /* 1 = wall to left,
165 2 = wall to right,
166 4 = wall above
167 8 = wall below */
168 int surround_index=0;
169 int l;
170 char wall_name[64];
171 archetype *wall_arch=0;
172
173 strcpy(wall_name,the_wall->arch->name);
174
175 /* conventionally, walls are named like this:
176 wallname_wallcode, where wallcode indicates
177 a joinedness, and wallname is the wall.
178 this code depends on the convention for
179 finding the right wall. */
180
181 /* extract the wall name, which is the text up to the leading _ */
182 for(l=0;l<64;l++) {
183 if(wall_name[l]=='_') {
184 wall_name[l] = 0;
185 break;
186 }
187 }
188
189 surround_index = surround_flag2(layout,i,j,RP);
190
191 switch(surround_index) {
192 case 0:
193 strcat(wall_name,"_0");
194 break;
195 case 1:
196 strcat(wall_name,"_1_3");
197 break;
198 case 2:
199 strcat(wall_name,"_1_4");
200 break;
201 case 3:
202 strcat(wall_name,"_2_1_2");
203 break;
204 case 4:
205 strcat(wall_name,"_1_2");
206 break;
207 case 5:
208 strcat(wall_name,"_2_2_4");
209 break;
210 case 6:
211 strcat(wall_name,"_2_2_1");
212 break;
213 case 7:
214 strcat(wall_name,"_3_1");
215 break;
216 case 8:
217 strcat(wall_name,"_1_1");
218 break;
219 case 9:
220 strcat(wall_name,"_2_2_3");
221 break;
222 case 10:
223 strcat(wall_name,"_2_2_2");
224 break;
225 case 11:
226 strcat(wall_name,"_3_3");
227 break;
228 case 12:
229 strcat(wall_name,"_2_1_1");
230 break;
231 case 13:
232 strcat(wall_name,"_3_4");
233 break;
234 case 14:
235 strcat(wall_name,"_3_2");
236 break;
237 case 15:
238 strcat(wall_name,"_4");
239 break;
240 }
241 wall_arch = find_archetype(wall_name);
242 if(wall_arch) return arch_to_object(wall_arch);
243 else {
244 nroferrors--;
245 return arch_to_object(the_wall->arch);
246 }
247
248
249}
250
251 277
252/* this takes a map, and changes an existing wall to match what's blocked 278/* this takes a map, and changes an existing wall to match what's blocked
253 * around it, counting only doors and walls as blocked. If insert_flag is 279 * around it, counting only doors and walls as blocked. If insert_flag is
254 * 1, it will go ahead and insert the wall into the map. If not, it 280 * 1, it will go ahead and insert the wall into the map. If not, it
255 * will only return the wall which would belong there, and doesn't 281 * will only return the wall which would belong there, and doesn't
256 * remove anything. It depends on the 282 * remove anything. It depends on the
257 * global, previously-set variable, "wall_name" 283 * global, previously-set variable, "wall_name"
258 */ 284 */
259 285object *
260object * retrofit_joined_wall(mapstruct *the_map,int i,int j,int insert_flag,RMParms *RP) { 286retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, random_map_params *RP)
287{
261 /* 1 = wall to left, 288 /* 1 = wall to left,
262 * 2 = wall to right, 289 * 2 = wall to right,
263 * 4 = wall above 290 * 4 = wall above
264 * 8 = wall below 291 * 8 = wall below
265 */ 292 */
266 int surround_index=0; 293 int surround_index = 0;
267 int l; 294 int l;
268 object *the_wall=0; 295 object *the_wall = 0;
269 object *new_wall=0; 296 object *new_wall = 0;
270 archetype * wall_arch=0; 297 archetype *wall_arch = 0;
271 298
272 /* first find the wall */ 299 /* first find the wall */
273 for(the_wall = get_map_ob(the_map,i,j);the_wall!=NULL;the_wall=the_wall->above) 300 for (the_wall = GET_MAP_OB (the_map, i, j); the_wall != NULL; the_wall = the_wall->above)
274 if ((the_wall->move_type & MOVE_WALK) && the_wall->type!=EXIT && the_wall->type!=TELEPORTER) 301 if ((the_wall->move_type & MOVE_WALK) && the_wall->type != EXIT && the_wall->type != TELEPORTER)
275 break; 302 break;
276 303
277 304
278 /* if what we found is a door, don't remove it, set the_wall to NULL to 305 /* if what we found is a door, don't remove it, set the_wall to NULL to
279 * signal that later. 306 * signal that later.
280 */ 307 */
281 if(the_wall && (the_wall->type==DOOR || the_wall->type==LOCKED_DOOR) ) { 308 if (the_wall && (the_wall->type == DOOR || the_wall->type == LOCKED_DOOR))
309 {
282 the_wall=NULL; 310 the_wall = NULL;
283 /* if we're not supposed to insert a new wall where there wasn't one, 311 /* if we're not supposed to insert a new wall where there wasn't one,
284 * we've gotta leave. 312 * we've gotta leave.
285 */ 313 */
286 if(insert_flag==0) return 0; 314 if (insert_flag == 0)
315 return 0;
287 } 316 }
288 else if(the_wall==NULL) return NULL; 317 else if (the_wall == NULL)
318 return NULL;
289 319
290 /* canonicalize the wall name */ 320 /* canonicalize the wall name */
291 for(l=0;l<64;l++) { 321 for (l = 0; l < 64; l++)
322 {
292 if(RP->wall_name[l]=='_') { 323 if (RP->wall_name[l] == '_')
324 {
293 RP->wall_name[l] = 0; 325 RP->wall_name[l] = 0;
294 break; 326 break;
295 } 327 }
296 } 328 }
297 329
298 surround_index = surround_flag4(the_map,i,j,RP); 330 surround_index = surround_flag4 (the_map, i, j, RP);
299 /* This would be a lot cleaner to just us a lookup table, 331 /* This would be a lot cleaner to just us a lookup table,
300 * eg, wall_suffix[surround_index] 332 * eg, wall_suffix[surround_index]
301 */ 333 */
302 switch(surround_index) { 334 switch (surround_index)
303 case 0: 335 {
336 case 0:
304 strcat(RP->wall_name,"_0"); 337 strcat (RP->wall_name, "_0");
305 break; 338 break;
306 case 1: 339 case 1:
307 strcat(RP->wall_name,"_1_3"); 340 strcat (RP->wall_name, "_1_3");
308 break; 341 break;
309 case 2: 342 case 2:
310 strcat(RP->wall_name,"_1_4"); 343 strcat (RP->wall_name, "_1_4");
311 break; 344 break;
312 case 3: 345 case 3:
313 strcat(RP->wall_name,"_2_1_2"); 346 strcat (RP->wall_name, "_2_1_2");
314 break; 347 break;
315 case 4: 348 case 4:
316 strcat(RP->wall_name,"_1_2"); 349 strcat (RP->wall_name, "_1_2");
317 break; 350 break;
318 case 5: 351 case 5:
319 strcat(RP->wall_name,"_2_2_4"); 352 strcat (RP->wall_name, "_2_2_4");
320 break; 353 break;
321 case 6: 354 case 6:
322 strcat(RP->wall_name,"_2_2_1"); 355 strcat (RP->wall_name, "_2_2_1");
323 break; 356 break;
324 case 7: 357 case 7:
325 strcat(RP->wall_name,"_3_1"); 358 strcat (RP->wall_name, "_3_1");
326 break; 359 break;
327 case 8: 360 case 8:
328 strcat(RP->wall_name,"_1_1"); 361 strcat (RP->wall_name, "_1_1");
329 break; 362 break;
330 case 9: 363 case 9:
331 strcat(RP->wall_name,"_2_2_3"); 364 strcat (RP->wall_name, "_2_2_3");
332 break; 365 break;
333 case 10: 366 case 10:
334 strcat(RP->wall_name,"_2_2_2"); 367 strcat (RP->wall_name, "_2_2_2");
335 break; 368 break;
336 case 11: 369 case 11:
337 strcat(RP->wall_name,"_3_3"); 370 strcat (RP->wall_name, "_3_3");
338 break; 371 break;
339 case 12: 372 case 12:
340 strcat(RP->wall_name,"_2_1_1"); 373 strcat (RP->wall_name, "_2_1_1");
341 break; 374 break;
342 case 13: 375 case 13:
343 strcat(RP->wall_name,"_3_4"); 376 strcat (RP->wall_name, "_3_4");
344 break; 377 break;
345 case 14: 378 case 14:
346 strcat(RP->wall_name,"_3_2"); 379 strcat (RP->wall_name, "_3_2");
347 break; 380 break;
348 case 15: 381 case 15:
349 strcat(RP->wall_name,"_4"); 382 strcat (RP->wall_name, "_4");
350 break; 383 break;
351 } 384 }
385
352 wall_arch = find_archetype(RP->wall_name); 386 wall_arch = archetype::find (RP->wall_name);
353 if(wall_arch!=NULL) { 387
388 if (!wall_arch)
389 {
354 new_wall=arch_to_object(wall_arch); 390 new_wall = arch_to_object (wall_arch);
355 new_wall->x = i; 391 new_wall->x = i;
356 new_wall->y = j; 392 new_wall->y = j;
393
357 if(the_wall && the_wall->map) { 394 if (the_wall && the_wall->map)
358 remove_ob(the_wall); 395 the_wall->destroy ();
359 free_object(the_wall); 396
360 }
361 the_wall->move_block = MOVE_ALL; 397 the_wall->move_block = MOVE_ALL;
362 insert_ob_in_map(new_wall,the_map,new_wall,INS_NO_MERGE | INS_NO_WALK_ON); 398 insert_ob_in_map (new_wall, the_map, new_wall, INS_NO_MERGE | INS_NO_WALK_ON);
363 } 399 }
364 else 400
365 nroferrors--; /* it's OK not to find an arch. */
366 return new_wall; 401 return new_wall;
367} 402}
368
369

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines