--- deliantra/server/random_maps/exit.C 2010/07/05 00:07:21 1.49 +++ deliantra/server/random_maps/exit.C 2017/09/16 22:17:42 1.56 @@ -1,29 +1,29 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. - * - * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * + * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2001 Mark Wedel & Crossfire Development Team * Copyright (©) 1992 Frank Tore Johansen - * + * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the Affero GNU General Public License * and the GNU General Public License along with this program. If not, see * . - * + * * The authors can be reached via e-mail to */ #include -#include +#include #include #include @@ -211,9 +211,9 @@ /* find an empty place far from the center */ if (upx == 1 && upy == 1) find_in_layout (1, 0, upx, upy, maze); - else if (upx == 1 && upy > 1) find_in_layout (4, 0, upx, upy, maze); else if (upx > 1 && upy == 1) find_in_layout (2, 0, upx, upy, maze); else if (upx > 1 && upy > 1) find_in_layout (3, 0, upx, upy, maze); + else if (upx == 1 && upy > 1) find_in_layout (4, 0, upx, upy, maze); } /* no indication of where to place the exit, so just place it. */ @@ -225,11 +225,11 @@ /* surround the exits with notices that this is a random map. */ for (int j = 1; j < 9; j++) - if (!wall_blocked (map, the_exit_up->x + freearr_x[j], the_exit_up->y + freearr_y[j])) + if (!wall_blocked (map, the_exit_up->x + DIRX (j), the_exit_up->y + DIRY (j))) { object *random_sign = archetype::get (shstr_sign); random_sign->msg = format ("This is a random map.\nLevel: %d of %d.\n", RP->dungeon_level - 1, RP->dungeon_depth); - map->insert (random_sign, the_exit_up->x + freearr_x[j], the_exit_up->y + freearr_y[j], 0, 0); + map->insert (random_sign, the_exit_up->x + DIRX (j), the_exit_up->y + DIRY (j), 0, 0); } /* Block the exit so things don't get dumped on top of it. */ @@ -268,9 +268,9 @@ /* find an empty place far from the entrance */ if (downx == 1 && downy == 1) find_in_layout (1, 0, downx, downy, maze); - else if (downx == 1 && downy > 1) find_in_layout (4, 0, downx, downy, maze); else if (downx > 1 && downy == 1) find_in_layout (2, 0, downx, downy, maze); else if (downx > 1 && downy > 1) find_in_layout (3, 0, downx, downy, maze); + else if (downx == 1 && downy > 1) find_in_layout (4, 0, downx, downy, maze); } /* no indication of where to place the down exit, so just place it */ @@ -281,8 +281,8 @@ { int i = rmg_find_free_spot (the_exit_down, map, downx, downy, 1, SIZEOFFREE1 + 1); - the_exit_down->x = downx + freearr_x[i]; - the_exit_down->y = downy + freearr_y[i]; + the_exit_down->x = downx + DIRX (i); + the_exit_down->y = downy + DIRY (i); RP->set ("origin_x", (IV)the_exit_down->x); RP->set ("origin_y", (IV)the_exit_down->y);