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.26 by root, Fri Feb 16 19:43:41 2007 UTC vs.
Revision 1.32 by root, Mon May 28 21:21:40 2007 UTC

1/* 1/*
2 * CrossFire, A Multiplayer game for X-windows 2 * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game.
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
5 * Copyright (C) 2001-2003 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2001-2003,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * Crossfire TRT is free software; you can redistribute it and/or modify it
9 * it under the terms of the GNU General Public License as published by 9 * under the terms of the GNU General Public License as published by the Free
10 * the Free Software Foundation; either version 2 of the License, or 10 * Software Foundation; either version 2 of the License, or (at your option)
11 * (at your option) any later version. 11 * 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, but
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * GNU General Public License for more details. 16 * 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 GNU General Public License along
19 * along with this program; if not, write to the Free Software 19 * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 * 21 *
22 * The authors can be reached via e-mail at <crossfire@schmorp.de> 22 * The authors can be reached via e-mail to <crossfire@schmorp.de>
23 */ 23 */
24 24
25#include <global.h> 25#include <global.h>
26#include <unistd.h> 26#include <unistd.h>
27 27
196 { 196 {
197 case KW_parent: 197 case KW_parent:
198 rgn->parent = region::find (f.get_str ()); 198 rgn->parent = region::find (f.get_str ());
199 break; 199 break;
200 200
201 case KW_msg: f.get_ml (KW_endmsg, rgn->msg); break;
202 case KW_longname: f.get (rgn->longname); break;
203 case KW_match: f.get (rgn->match); break;
204 case KW_jail_map: f.get (rgn->jailmap); break;
205 case KW_jail_x: f.get (rgn->jailx); break;
206 case KW_jail_y: f.get (rgn->jaily); break;
207 case KW_portal_map: f.get (rgn->portalmap);break;
208 case KW_portal_x: f.get (rgn->portalx); break;
209 case KW_portal_y: f.get (rgn->portaly); break;
210 case KW_fallback: f.get (rgn->fallback); break;
211 case KW_chance: f.get (rgn->treasure_density); break;
212
201 case KW_longname: 213 case KW_randomitems:
202 f.get (rgn->longname); 214 rgn->treasure = treasurelist::get (f.get_str ());
203 break; 215 break;
204 216
205 case KW_jail_map:
206 f.get (rgn->jailmap);
207 break;
208
209 case KW_jail_x:
210 f.get (rgn->jailx);
211 break;
212
213 case KW_jail_y:
214 f.get (rgn->jaily);
215 break;
216
217 case KW_msg:
218 f.get_ml (KW_endmsg, rgn->msg);
219 break;
220
221 case KW_fallback:
222 f.get (rgn->fallback);
223 break;
224
225 case KW_end: 217 case KW_end:
218 f.next ();
219
226 for_all_regions (old) 220 for_all_regions (old)
227 if (old->name == rgn->name) 221 if (old->name == rgn->name)
228 { 222 {
229 // replace, copy new values (ugly) 223 // replace, copy new values (ugly)
230 rgn->index = old->index; 224 rgn->index = old->index;
253 247
254/* 248/*
255 * First initialises the archtype hash-table (init_archetable()). 249 * First initialises the archtype hash-table (init_archetable()).
256 * Reads and parses the archetype file (with the first and second-pass 250 * Reads and parses the archetype file (with the first and second-pass
257 * functions). 251 * functions).
258 * Then initialises treasures by calling load_treasures().
259 */ 252 */
260void 253void
261init_regions (void) 254init_regions (void)
262{ 255{
263 if (!regions.size ()) 256 if (!regions.size ())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines