--- deliantra/server/random_maps/door.C 2006/09/16 22:24:12 1.5 +++ deliantra/server/random_maps/door.C 2006/12/31 20:46:17 1.10 @@ -1,3 +1,4 @@ + /* CrossFire, A Multiplayer game for X-windows @@ -47,16 +48,18 @@ } void -put_doors (maptile *the_map, char **maze, const char *doorstyle, RMParms * RP) +put_doors (maptile *the_map, char **maze, const char *doorstyle, random_map_params *RP) { int i, j; maptile *vdoors; maptile *hdoors; - char doorpath[128]; + char doorpath[1024]; if (!strcmp (doorstyle, "none")) return; + vdoors = find_style ("/styles/doorstyles", doorstyle, -1); + if (vdoors) hdoors = vdoors; else @@ -67,6 +70,7 @@ sprintf (doorpath, "/styles/doorstyles/hdoors%s", strrchr (vdoors->path, '/')); hdoors = find_style (doorpath, 0, -1); } + for (i = 0; i < RP->Xsize; i++) for (j = 0; j < RP->Ysize; j++) { @@ -80,8 +84,12 @@ this_door = pick_random_object (hdoors); else this_door = pick_random_object (vdoors); + + if (!this_door) + abort (); + new_door = arch_to_object (this_door->arch); - copy_object (this_door, new_door); + this_door->copy_to (new_door); new_door->x = i; new_door->y = j; insert_ob_in_map (new_door, the_map, NULL, 0);