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.52 by root, Sat Apr 23 04:56:52 2011 UTC vs.
Revision 1.57 by root, Sat Nov 17 23:40:02 2018 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team
4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 5 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2001 Mark Wedel & Crossfire Development Team 6 * Copyright (©) 2001 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992 Frank Tore Johansen 7 * Copyright (©) 1992 Frank Tore Johansen
7 * 8 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 9 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 10 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your 11 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version. 12 * option) any later version.
12 * 13 *
13 * This program is distributed in the hope that it will be useful, 14 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 17 * GNU General Public License for more details.
17 * 18 *
18 * You should have received a copy of the Affero GNU General Public License 19 * You should have received a copy of the Affero GNU General Public License
19 * and the GNU General Public License along with this program. If not, see 20 * and the GNU General Public License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>. 21 * <http://www.gnu.org/licenses/>.
21 * 22 *
22 * The authors can be reached via e-mail to <support@deliantra.net> 23 * The authors can be reached via e-mail to <support@deliantra.net>
23 */ 24 */
24 25
25#include <global.h> 26#include <global.h>
26#include <rmg.h> 27#include <rmg.h>
223 the_exit_up->x = upx; 224 the_exit_up->x = upx;
224 the_exit_up->y = upy; 225 the_exit_up->y = upy;
225 226
226 /* surround the exits with notices that this is a random map. */ 227 /* surround the exits with notices that this is a random map. */
227 for (int j = 1; j < 9; j++) 228 for (int j = 1; j < 9; j++)
228 if (!wall_blocked (map, the_exit_up->x + freearr_x[j], the_exit_up->y + freearr_y[j])) 229 if (!wall_blocked (map, the_exit_up->x + DIRX (j), the_exit_up->y + DIRY (j)))
229 { 230 {
230 object *random_sign = archetype::get (shstr_sign); 231 object *random_sign = archetype::get (shstr_sign);
231 random_sign->msg = format ("This is a random map.\nLevel: %d of %d.\n", RP->dungeon_level - 1, RP->dungeon_depth); 232 random_sign->msg = format ("This is a random map.\nLevel: %d of %d.\n", RP->dungeon_level - 1, RP->dungeon_depth);
232 map->insert (random_sign, the_exit_up->x + freearr_x[j], the_exit_up->y + freearr_y[j], 0, 0); 233 map->insert (random_sign, the_exit_up->x + DIRX (j), the_exit_up->y + DIRY (j), 0, 0);
233 } 234 }
234 235
235 /* Block the exit so things don't get dumped on top of it. */ 236 /* Block the exit so things don't get dumped on top of it. */
236 the_exit_up->move_block = MOVE_ALL; 237 the_exit_up->move_block = MOVE_ALL;
237 238
279 280
280 if (the_exit_down) 281 if (the_exit_down)
281 { 282 {
282 int i = rmg_find_free_spot (the_exit_down, map, downx, downy, 1, SIZEOFFREE1 + 1); 283 int i = rmg_find_free_spot (the_exit_down, map, downx, downy, 1, SIZEOFFREE1 + 1);
283 284
284 the_exit_down->x = downx + freearr_x[i]; 285 the_exit_down->x = downx + DIRX (i);
285 the_exit_down->y = downy + freearr_y[i]; 286 the_exit_down->y = downy + DIRY (i);
286 287
287 RP->set ("origin_x", (IV)the_exit_down->x); 288 RP->set ("origin_x", (IV)the_exit_down->x);
288 RP->set ("origin_y", (IV)the_exit_down->y); 289 RP->set ("origin_y", (IV)the_exit_down->y);
289 290
290 the_exit_down->msg = RP->as_shstr (); 291 the_exit_down->msg = RP->as_shstr ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines