version 1.4 | | version 1.5 |
---|
| | |
/* | | /* |
* static char *rcsid_main_c = | | * static char *rcsid_main_c = |
* "$Id: main.c,v 1.4 1999/07/13 06:03:04 cvs Exp $"; | | * "$Id: main.c,v 1.5 1999/08/14 13:35:12 damn Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
} | | } |
| | |
/* pick a new pathname for the new map: it is of the form | | /* pick a new pathname for the new map: it is of the form |
oldmapname_x_y with underscores instead of '/' and '.', with | | * oldmapname_x_y with underscores instead of '/' and '.', with |
the entrance coordinates tacked on. */ | | * the entrance coordinates tacked on. */ |
sprintf(newmap_name,"/random/%s_%d_%d",oldmap_name,exit_ob->x,exit_ob->y); | | sprintf(newmap_name,"/random/%s_%d_%d",oldmap_name,exit_ob->x,exit_ob->y); |
| | |
/* now to generate the actual map. */ | | /* now to generate the actual map. */ |
| | |
} | | } |
} | | } |
if (EXIT_PATH(exit_ob)) { | | if (EXIT_PATH(exit_ob)) { |
| | /* If we're already in a unique map, get the map's original path from its basename -- DAMN */ |
| | if (exit_ob->map && exit_ob->map->path) { |
| | sprintf(apartment, "%s/%s/%s/", settings.localdir, settings.playerdir, op->name); |
| | if (!strncmp(exit_ob->map->path, apartment, strlen(apartment))) { |
| | char *t; |
| | LOG(llevDebug,"%s is leaving unique map %s.\n", op->name, exit_ob->map->path); |
| | if((t = strrchr(exit_ob->map->path,'/'))) { |
| | t++; |
| | strcpy(apartment, t); |
| | } else { /* This "shouldn't" happen. */ |
| | LOG(llevError,"Pathless unique map: '%s'?\n", exit_ob->map->path); |
| | strcpy(apartment, exit_ob->map->path); |
| | } |
| | while((t = strchr(apartment,'_'))) t[0] = '/'; |
| | newpath = normalize_path (apartment, EXIT_PATH(exit_ob)); |
| | } else { |
| | newpath = normalize_path (exit_ob->map->path, EXIT_PATH(exit_ob)); |
| | } |
| | } else { |
newpath = normalize_path (exit_ob->map->path, EXIT_PATH(exit_ob)); | | newpath = normalize_path (exit_ob->map->path, EXIT_PATH(exit_ob)); |
| | } |
} else { | | } else { |
if (EXIT_LEVEL (exit_ob) > 0) | | if (EXIT_LEVEL (exit_ob) > 0) |
LOG(llevError,"Number Map levels are no more supported\n"); | | LOG(llevError,"Number Map levels are no longer supported\n"); |
return; | | return; |
} | | } |
} else | | } else |
newpath = op->contr->maplevel; | | newpath = op->contr->maplevel; |
| | |
| | |
/* If no map path has been found yet, just keep the player on the | | /* If no map path has been found yet, just keep the player on the |
* map he is on right now | | * map he is on right now |
*/ | | */ |
| | |
return; | | return; |
} | | } |
| | |
| | |
/* Clear the player's count, and reset direction */ | | /* Clear the player's count, and reset direction */ |
op->direction=0; | | op->direction=0; |
op->contr->count=0; | | op->contr->count=0; |
| | |
/* Keep track of the map the player is on right now */ | | /* Keep track of the map the player is on right now */ |
oldmap=op->map; | | oldmap=op->map; |
| | |
| | |
/* When logging in, the object is already removed. If that is | | /* When logging in, the object is already removed. If that is |
* not the case, then the following is used */ | | * not the case, then the following is used */ |
if(!removed) { | | if(!removed) { |
| | |
/* Do any processing to get the map loaded and ready */ | | /* Do any processing to get the map loaded and ready */ |
op->map = ready_map_name(newpath,(unique?MAP_PLAYER_UNIQUE:0)); | | op->map = ready_map_name(newpath,(unique?MAP_PLAYER_UNIQUE:0)); |
| | |
| | |
/* Did the load fail for some reason? If so, put the player back on the | | /* Did the load fail for some reason? If so, put the player back on the |
* map they came from and remove the exit that pointed the player to | | * map they came from and remove the exit that pointed the player to |
* the bad map. | | * the bad map. |