1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_map_c = |
|
|
4 | * "$Id: region.C,v 1.4 2006/09/10 16:00:23 root Exp $"; |
|
|
5 | */ |
|
|
6 | |
|
|
7 | /* |
1 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
9 | |
3 | |
10 | Copyright (C) 2001-2003 Mark Wedel & Crossfire Development Team |
4 | Copyright (C) 2001-2003 Mark Wedel & Crossfire Development Team |
11 | Copyright (C) 1992 Frank Tore Johansen |
5 | Copyright (C) 1992 Frank Tore Johansen |
… | |
… | |
22 | |
16 | |
23 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
24 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
25 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | |
20 | |
27 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | |
23 | |
30 | |
24 | |
31 | #include <global.h> |
25 | #include <global.h> |
32 | |
26 | |
… | |
… | |
66 | return NULL; |
60 | return NULL; |
67 | } |
61 | } |
68 | |
62 | |
69 | /* This might need optimising at some point. */ |
63 | /* This might need optimising at some point. */ |
70 | region * |
64 | region * |
71 | get_region_by_map (mapstruct *m) |
65 | get_region_by_map (maptile *m) |
72 | { |
66 | { |
73 | return get_region_by_name (get_name_of_region_for_map (m)); |
67 | return get_region_by_name (get_name_of_region_for_map (m)); |
74 | } |
68 | } |
75 | |
69 | |
76 | /* |
70 | /* |
… | |
… | |
78 | * explicit check that it is, this is much nicer here than scattered throughout |
72 | * explicit check that it is, this is much nicer here than scattered throughout |
79 | * the map code. |
73 | * the map code. |
80 | */ |
74 | */ |
81 | |
75 | |
82 | const char * |
76 | const char * |
83 | get_name_of_region_for_map (const mapstruct *m) |
77 | get_name_of_region_for_map (const maptile *m) |
84 | { |
78 | { |
85 | region *reg; |
79 | region *reg; |
86 | |
80 | |
87 | if (m->region != NULL) |
81 | if (m->region != NULL) |
88 | return m->region->name; |
82 | return m->region->name; |