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.6 by root, Thu Sep 14 22:34:00 2006 UTC vs.
Revision 1.9 by root, Tue Dec 12 21:39:56 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.
60 return NULL; 57 return NULL;
61} 58}
62 59
63/* This might need optimising at some point. */ 60/* This might need optimising at some point. */
64region * 61region *
65get_region_by_map (mapstruct *m) 62get_region_by_map (maptile *m)
66{ 63{
67 return get_region_by_name (get_name_of_region_for_map (m)); 64 return get_region_by_name (get_name_of_region_for_map (m));
68} 65}
69 66
70/* 67/*
72 * explicit check that it is, this is much nicer here than scattered throughout 69 * explicit check that it is, this is much nicer here than scattered throughout
73 * the map code. 70 * the map code.
74 */ 71 */
75 72
76const char * 73const char *
77get_name_of_region_for_map (const mapstruct *m) 74get_name_of_region_for_map (const maptile *m)
78{ 75{
79 region *reg; 76 region *reg;
80 77
81 if (m->region != NULL) 78 if (m->region != NULL)
82 return m->region->name; 79 return m->region->name;
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines