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

Comparing deliantra/server/random_maps/wall.C (file contents):
Revision 1.49 by root, Mon Oct 29 23:55:54 2012 UTC vs.
Revision 1.52 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,2012 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 (©) 2002 Mark Wedel & Crossfire Development Team 6 * Copyright (©) 2002 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
76{ 77{
77 /* 78 /*
78 * 1 = blocked to left, 79 * 1 = blocked to left,
79 * 2 = blocked to right, 80 * 2 = blocked to right,
80 * 4 = blocked above 81 * 4 = blocked above
81 * 8 = blocked below 82 * 8 = blocked below
82 */ 83 */
83 int surround_index = 0; 84 int surround_index = 0;
84 85
85 // don't forget to update the mapspace! 86 // don't forget to update the mapspace!
86 if (i > 0) map->at (i - 1, j ).update (); 87 if (i > 0) map->at (i - 1, j ).update ();
242/* this takes a map, and changes an existing wall to match what's blocked 243/* this takes a map, and changes an existing wall to match what's blocked
243 * around it, counting only doors and walls as blocked. If insert_flag is 244 * around it, counting only doors and walls as blocked. If insert_flag is
244 * 1, it will go ahead and insert the wall into the map. If not, it 245 * 1, it will go ahead and insert the wall into the map. If not, it
245 * will only return the wall which would belong there, and doesn't 246 * will only return the wall which would belong there, and doesn't
246 * remove anything. It depends on the 247 * remove anything. It depends on the
247 * global, previously-set variable, "wall_name" 248 * global, previously-set variable, "wall_name"
248 */ 249 */
249object * 250object *
250retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, random_map_params *RP) 251retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, random_map_params *RP)
251{ 252{
252 int l; 253 int l;
258 for (the_wall = GET_MAP_OB (the_map, i, j); the_wall; the_wall = the_wall->above) 259 for (the_wall = GET_MAP_OB (the_map, i, j); the_wall; the_wall = the_wall->above)
259 if ((the_wall->move_type & MOVE_WALK) && the_wall->type != EXIT && the_wall->type != TELEPORTER) 260 if ((the_wall->move_type & MOVE_WALK) && the_wall->type != EXIT && the_wall->type != TELEPORTER)
260 break; 261 break;
261 262
262 /* if what we found is a door, don't remove it, set the_wall to NULL to 263 /* if what we found is a door, don't remove it, set the_wall to NULL to
263 * signal that later. 264 * signal that later.
264 */ 265 */
265 if (the_wall && (the_wall->type == DOOR || the_wall->type == LOCKED_DOOR)) 266 if (the_wall && (the_wall->type == DOOR || the_wall->type == LOCKED_DOOR))
266 { 267 {
267 the_wall = NULL; 268 the_wall = NULL;
268 /* if we're not supposed to insert a new wall where there wasn't one, 269 /* if we're not supposed to insert a new wall where there wasn't one,
269 * we've gotta leave. 270 * we've gotta leave.
270 */ 271 */
271 if (insert_flag == 0) 272 if (insert_flag == 0)
272 return 0; 273 return 0;
273 } 274 }
274 else if (the_wall == NULL) 275 else if (the_wall == NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines