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.10 by root, Wed Dec 20 09:14:22 2006 UTC vs.
Revision 1.11 by root, Sat Dec 30 10:16:11 2006 UTC

267 case 15: 267 case 15:
268 strcat (wall_name, "_4"); 268 strcat (wall_name, "_4");
269 break; 269 break;
270 } 270 }
271 wall_arch = archetype::find (wall_name); 271 wall_arch = archetype::find (wall_name);
272 if (wall_arch) 272
273 return wall_arch
273 return arch_to_object (wall_arch); 274 ? arch_to_object (wall_arch)
274 else
275 {
276 nroferrors--;
277 return arch_to_object (the_wall->arch); 275 : arch_to_object (the_wall->arch);
278 }
279
280
281} 276}
282 277
283 278
284/* this takes a map, and changes an existing wall to match what's blocked 279/* this takes a map, and changes an existing wall to match what's blocked
285 * around it, counting only doors and walls as blocked. If insert_flag is 280 * around it, counting only doors and walls as blocked. If insert_flag is
387 break; 382 break;
388 case 15: 383 case 15:
389 strcat (RP->wall_name, "_4"); 384 strcat (RP->wall_name, "_4");
390 break; 385 break;
391 } 386 }
387
392 wall_arch = archetype::find (RP->wall_name); 388 wall_arch = archetype::find (RP->wall_name);
389
393 if (wall_arch != NULL) 390 if (!wall_arch)
394 { 391 {
395 new_wall = arch_to_object (wall_arch); 392 new_wall = arch_to_object (wall_arch);
396 new_wall->x = i; 393 new_wall->x = i;
397 new_wall->y = j; 394 new_wall->y = j;
395
398 if (the_wall && the_wall->map) 396 if (the_wall && the_wall->map)
399 { 397 {
400 the_wall->remove (); 398 the_wall->remove ();
401 the_wall->destroy (); 399 the_wall->destroy ();
402 } 400 }
401
403 the_wall->move_block = MOVE_ALL; 402 the_wall->move_block = MOVE_ALL;
404 insert_ob_in_map (new_wall, the_map, new_wall, INS_NO_MERGE | INS_NO_WALK_ON); 403 insert_ob_in_map (new_wall, the_map, new_wall, INS_NO_MERGE | INS_NO_WALK_ON);
405 } 404 }
406 else 405
407 nroferrors--; /* it's OK not to find an arch. */
408 return new_wall; 406 return new_wall;
409} 407}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines