--- deliantra/server/random_maps/wall.C 2006/12/20 09:14:22 1.10 +++ deliantra/server/random_maps/wall.C 2006/12/30 18:45:28 1.12 @@ -32,7 +32,7 @@ are occupied. */ int -surround_flag (char **layout, int i, int j, RMParms * RP) +surround_flag (char **layout, int i, int j, random_map_params * RP) { /* 1 = wall to left, 2 = wall to right, @@ -56,7 +56,7 @@ */ int -surround_flag2 (char **layout, int i, int j, RMParms * RP) +surround_flag2 (char **layout, int i, int j, random_map_params * RP) { /* 1 = wall to left, 2 = wall to right, @@ -82,7 +82,7 @@ * What is considered blocking and not is somewhat hard coded. */ int -surround_flag3 (maptile *map, sint16 i, sint16 j, RMParms * RP) +surround_flag3 (maptile *map, sint16 i, sint16 j, random_map_params * RP) { /* * 1 = blocked to left, @@ -108,7 +108,7 @@ /* like surround_flag2, except it checks a map, not a layout. */ int -surround_flag4 (maptile *map, int i, int j, RMParms * RP) +surround_flag4 (maptile *map, int i, int j, random_map_params * RP) { /* 1 = blocked to left, 2 = blocked to right, @@ -132,7 +132,7 @@ w_style) at '#' marks. */ void -make_map_walls (maptile *map, char **layout, char *w_style, RMParms * RP) +make_map_walls (maptile *map, char **layout, char *w_style, random_map_params * RP) { char styledirname[256]; char stylefilepath[256]; @@ -186,7 +186,7 @@ and have everything nicely joined. It uses the layout. */ object * -pick_joined_wall (object *the_wall, char **layout, int i, int j, RMParms * RP) +pick_joined_wall (object *the_wall, char **layout, int i, int j, random_map_params * RP) { /* 1 = wall to left, 2 = wall to right, @@ -269,15 +269,10 @@ break; } wall_arch = archetype::find (wall_name); - if (wall_arch) - return arch_to_object (wall_arch); - else - { - nroferrors--; - return arch_to_object (the_wall->arch); - } - + return wall_arch + ? arch_to_object (wall_arch) + : arch_to_object (the_wall->arch); } @@ -290,7 +285,7 @@ */ object * -retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, RMParms * RP) +retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, random_map_params * RP) { /* 1 = wall to left, * 2 = wall to right, @@ -389,21 +384,24 @@ strcat (RP->wall_name, "_4"); break; } + wall_arch = archetype::find (RP->wall_name); - if (wall_arch != NULL) + + if (!wall_arch) { new_wall = arch_to_object (wall_arch); new_wall->x = i; new_wall->y = j; + if (the_wall && the_wall->map) { the_wall->remove (); the_wall->destroy (); } + the_wall->move_block = MOVE_ALL; insert_ob_in_map (new_wall, the_map, new_wall, INS_NO_MERGE | INS_NO_WALK_ON); } - else - nroferrors--; /* it's OK not to find an arch. */ + return new_wall; }