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.3 by root, Sun Sep 3 00:18:42 2006 UTC vs.
Revision 1.23 by root, Sun Jul 1 05:00:19 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines