ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/exit.C
(Generate patch)

Comparing deliantra/server/random_maps/exit.C (file contents):
Revision 1.12 by root, Sat Dec 30 10:16:11 2006 UTC vs.
Revision 1.14 by root, Sun Dec 31 10:28:36 2006 UTC

28 28
29 29
30/* find a character in the layout. fx and fy are pointers to 30/* find a character in the layout. fx and fy are pointers to
31 where to find the char. fx,fy = -1 if not found. */ 31 where to find the char. fx,fy = -1 if not found. */
32void 32void
33find_in_layout (int mode, char target, int *fx, int *fy, char **layout, RMParms * RP) 33find_in_layout (int mode, char target, int *fx, int *fy, char **layout, random_map_params * RP)
34{ 34{
35 int M; 35 int M;
36 int i, j; 36 int i, j;
37 37
38 *fx = -1; 38 *fx = -1;
115 4 means leftward 115 4 means leftward
116 5 means northward 116 5 means northward
117 6 means southward 117 6 means southward
118*/ 118*/
119void 119void
120place_exits (maptile *map, char **maze, char *exitstyle, int orientation, RMParms *RP) 120place_exits (maptile *map, char **maze, char *exitstyle, int orientation, random_map_params *RP)
121{ 121{
122 char styledirname[256]; 122 char styledirname[256];
123 maptile *style_map_down = 0; /* harder maze */ 123 maptile *style_map_down = 0; /* harder maze */
124 maptile *style_map_up = 0; /* easier maze */ 124 maptile *style_map_up = 0; /* easier maze */
125 object *the_exit_down; /* harder maze */ 125 object *the_exit_down; /* harder maze */
325 /* give the final map a name */ 325 /* give the final map a name */
326 sprintf (new_map_name, "%sfinal_map", RP->final_map); 326 sprintf (new_map_name, "%sfinal_map", RP->final_map);
327 /* set the exit down. */ 327 /* set the exit down. */
328#endif 328#endif
329 /* load it */ 329 /* load it */
330 if (!(new_map = maptile::find_map (RP->final_map, 0))) 330 if (!(new_map = maptile::load_map_sync (RP->final_map)))
331 return; 331 return;
332
333 new_map->load ();
334 332
335 the_exit_down->slaying = RP->final_map; 333 the_exit_down->slaying = RP->final_map;
336 334
337 for (tmp = new_map->at (new_map->enter_x, new_map->enter_y).bot; tmp; tmp = tmp->above) 335 for (tmp = new_map->at (new_map->enter_x, new_map->enter_y).bot; tmp; tmp = tmp->above)
338 /* Remove exit back to previous random map. There should only be one 336 /* Remove exit back to previous random map. There should only be one
355 the_exit_back->x = new_map->enter_x; 353 the_exit_back->x = new_map->enter_x;
356 the_exit_back->y = new_map->enter_y; 354 the_exit_back->y = new_map->enter_y;
357 355
358 insert_ob_in_map (the_exit_back, new_map, NULL, 0); 356 insert_ob_in_map (the_exit_back, new_map, NULL, 0);
359 } 357 }
360
361 set_map_timeout (new_map); /* So it gets swapped out */
362 } 358 }
363 else 359 else
364 the_exit_down->slaying = "/!"; 360 the_exit_down->slaying = "/!";
365 361
366 /* Block the exit so things don't get dumped on top of it. */ 362 /* Block the exit so things don't get dumped on top of it. */
374 370
375/* this function unblocks the exits. We blocked them to 371/* this function unblocks the exits. We blocked them to
376 keep things from being dumped on them during the other 372 keep things from being dumped on them during the other
377 phases of random map generation. */ 373 phases of random map generation. */
378void 374void
379unblock_exits (maptile *map, char **maze, RMParms * RP) 375unblock_exits (maptile *map, char **maze, random_map_params * RP)
380{ 376{
381 int i = 0, j = 0; 377 int i = 0, j = 0;
382 object *walk; 378 object *walk;
383 379
384 for (i = 0; i < RP->Xsize; i++) 380 for (i = 0; i < RP->Xsize; i++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines