version 1.108 | | version 1.109 |
---|
| | |
/* | | /* |
* static char *rcsid_main_c = | | * static char *rcsid_main_c = |
* "$Id: main.c,v 1.108 2006/01/05 18:44:47 qal21 Exp $"; | | * "$Id: main.c,v 1.109 2006/01/06 18:38:16 qal21 Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
} | | } |
*sourcemap++ = '\0'; | | *sourcemap++ = '\0'; |
| | |
| | /* If we are not coming from a template map, we can use reletive directories |
| | * for the map to generate from. |
| | */ |
| | if (!exit_ob->map->template) { |
| | sourcemap = path_combine_and_normalize(exit_ob->map->path, sourcemap); |
| | } |
| | |
| | /* Do replacement of %x, %y, and %n to the x coord of the exit, the y coord |
| | * of the exit, and the name of the map the exit is on, respectively. |
| | */ |
sprintf(tmpnum ,"%d", exit_ob->x); | | sprintf(tmpnum ,"%d", exit_ob->x); |
replace(exitpath, "%x", tmpnum, resultname, sizeof(resultname)); | | replace(exitpath, "%x", tmpnum, resultname, sizeof(resultname)); |
| | |
| | |
sprintf(tmpstring, "%s", resultname); | | sprintf(tmpstring, "%s", resultname); |
replace(tmpstring, "%n", exit_ob->map->name, resultname, sizeof(resultname)); | | replace(tmpstring, "%n", exit_ob->map->name, resultname, sizeof(resultname)); |
| | |
| | /* If we are coming from another template map, use reletive paths unless |
| | * indicated otherwise. |
| | */ |
| | if (exit_ob->map->template && (resultname[0] != '/')) { |
| | new_map_name = path_combine_and_normalize(exit_ob->map->path, resultname); |
| | } else { |
new_map_name = create_template_pathname(resultname); | | new_map_name = create_template_pathname(resultname); |
| | } |
| | |
/* Attempt to load the map, if unable to, then | | /* Attempt to load the map, if unable to, then |
* create the map from the template. | | * create the map from the template. |
| | |
const char *new_map_name; | | const char *new_map_name; |
RMParms rp; | | RMParms rp; |
| | |
| | /* Do replacement of %x, %y, and %n to the x coord of the exit, the y coord |
| | * of the exit, and the name of the map the exit is on, respectively. |
| | */ |
sprintf(tmpnum ,"%d", exit_ob->x); | | sprintf(tmpnum ,"%d", exit_ob->x); |
replace((EXIT_PATH(exit_ob)+3), "%x", tmpnum, resultname, sizeof(resultname)); | | replace((EXIT_PATH(exit_ob)+3), "%x", tmpnum, resultname, sizeof(resultname)); |
| | |
| | |
sprintf(tmpstring, "%s", resultname); | | sprintf(tmpstring, "%s", resultname); |
replace(tmpstring, "%n", exit_ob->map->name, resultname, sizeof(resultname)); | | replace(tmpstring, "%n", exit_ob->map->name, resultname, sizeof(resultname)); |
| | |
| | /* If we are coming from another template map, use reletive paths unless |
| | * indicated otherwise. |
| | */ |
| | if (exit_ob->map->template && (resultname[0] != '/')) { |
| | new_map_name = path_combine_and_normalize(exit_ob->map->path, resultname); |
| | } else { |
new_map_name = create_template_pathname(resultname); | | new_map_name = create_template_pathname(resultname); |
| | } |
| | |
new_map = ready_map_name(new_map_name, MAP_PLAYER_UNIQUE); | | new_map = ready_map_name(new_map_name, MAP_PLAYER_UNIQUE); |
if (!new_map) { | | if (!new_map) { |