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 (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2001-2003,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2001-2003 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * it under the terms of the GNU General Public License as published by |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * the Free Software Foundation, either version 3 of the License, or |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * (at your option) any later version. |
11 | * option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the Affero GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | * and the GNU General Public License along with this program. If not, see |
|
|
20 | * <http://www.gnu.org/licenses/>. |
20 | * |
21 | * |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | */ |
23 | */ |
23 | |
24 | |
24 | #include <global.h> |
25 | #include <global.h> |
… | |
… | |
63 | |
64 | |
64 | attachable::do_destroy (); |
65 | attachable::do_destroy (); |
65 | |
66 | |
66 | refcnt_dec (); |
67 | refcnt_dec (); |
67 | } |
68 | } |
|
|
69 | |
|
|
70 | //+GPL |
68 | |
71 | |
69 | /* |
72 | /* |
70 | * returns 1 if the player is in the region reg, or a child region thereof |
73 | * returns 1 if the player is in the region reg, or a child region thereof |
71 | * otherwise returns 0 |
74 | * otherwise returns 0 |
72 | * if passed a NULL region returns -1 |
75 | * if passed a NULL region returns -1 |
… | |
… | |
122 | |
125 | |
123 | LOG (llevError, "No suitable jailmap for region %s was found.\n", ®->name); |
126 | LOG (llevError, "No suitable jailmap for region %s was found.\n", ®->name); |
124 | |
127 | |
125 | return 0; |
128 | return 0; |
126 | } |
129 | } |
|
|
130 | |
|
|
131 | //-GPL |
127 | |
132 | |
128 | region * |
133 | region * |
129 | region::read (object_thawer &f) |
134 | region::read (object_thawer &f) |
130 | { |
135 | { |
131 | assert (f.kw == KW_region); |
136 | assert (f.kw == KW_region); |
… | |
… | |
190 | |
195 | |
191 | f.next (); |
196 | f.next (); |
192 | } |
197 | } |
193 | } |
198 | } |
194 | |
199 | |
195 | /* |
|
|
196 | * First initialises the archtype hash-table (init_archetable()). |
|
|
197 | * Reads and parses the archetype file (with the first and second-pass |
|
|
198 | * functions). |
|
|
199 | */ |
|
|
200 | void |
|
|
201 | init_regions (void) |
|
|
202 | { |
|
|
203 | if (!regions.size ()) |
|
|
204 | { |
|
|
205 | // make sure one region is always available |
|
|
206 | region *rgn = new region; |
|
|
207 | rgn->name = "<builtin>"; |
|
|
208 | rgn->longname = "Built-in Region"; |
|
|
209 | regions.push_back (rgn); |
|
|
210 | } |
|
|
211 | } |
|
|
212 | |
|
|