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

Comparing deliantra/server/common/region.C (file contents):
Revision 1.7 by root, Sat Sep 16 22:24:12 2006 UTC vs.
Revision 1.10 by root, Wed Dec 13 02:55:50 2006 UTC

21 The authors can be reached via e-mail at <crossfire@schmorp.de> 21 The authors can be reached via e-mail at <crossfire@schmorp.de>
22*/ 22*/
23 23
24 24
25#include <global.h> 25#include <global.h>
26
27#ifndef WIN32 /* ---win32 exclude header */
28# include <unistd.h> 26#include <unistd.h>
29#endif /* win32 */
30 27
31/* 28/*
32 * Pass a char array, returns a pointer to the region of the same name. 29 * Pass a char array, returns a pointer to the region of the same name.
33 * if it can't find a region of the same name it returns the first region 30 * if it can't find a region of the same name it returns the first region
34 * with the 'fallback' property set. 31 * with the 'fallback' property set.
237 reg = get_region_by_map (op->map); 234 reg = get_region_by_map (op->map);
238 while (reg != NULL) 235 while (reg != NULL)
239 { 236 {
240 if (reg->jailmap) 237 if (reg->jailmap)
241 { 238 {
242 exit = get_object (); 239 exit = object::create ();
243 EXIT_PATH (exit) = reg->jailmap; 240 EXIT_PATH (exit) = reg->jailmap;
244 /* damned exits reset savebed and remove teleports, so the prisoner can't escape */ 241 /* damned exits reset savebed and remove teleports, so the prisoner can't escape */
245 SET_FLAG (exit, FLAG_DAMNED); 242 SET_FLAG (exit, FLAG_DAMNED);
246 EXIT_X (exit) = reg->jailx; 243 EXIT_X (exit) = reg->jailx;
247 EXIT_Y (exit) = reg->jaily; 244 EXIT_Y (exit) = reg->jaily;
291 */ 288 */
292 289
293region * 290region *
294get_region_struct (void) 291get_region_struct (void)
295{ 292{
296
297 region *reg;
298
299 reg = (region *) CALLOC (1, sizeof (region));
300 if (reg == NULL)
301 fatal (OUT_OF_MEMORY);
302
303 memset (reg, '\0', sizeof (region));
304
305 return reg; 293 return new region;
306} 294}
307 295
308/* 296/*
309 * Reads/parses the region file, and copies into a linked list 297 * Reads/parses the region file, and copies into a linked list
310 * of region structs. 298 * of region structs.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines