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

Comparing deliantra/server/common/links.C (file contents):
Revision 1.4 by root, Sun Oct 15 02:16:34 2006 UTC vs.
Revision 1.14 by root, Sun Nov 29 10:55:18 2009 UTC

1/* 1/*
2 CrossFire, A Multiplayer game for X-windows 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 (C) 1992 Frank Tore Johansen 5 * Copyright (©) 1992,2007 Frank Tore Johansen
5 6 *
6 This program is free software; you can redistribute it and/or modify 7 * Deliantra is free software: you can redistribute it and/or modify it under
7 it under the terms of the GNU General Public License as published by 8 * the terms of the Affero GNU General Public License as published by the
8 the Free Software Foundation; either version 2 of the License, or 9 * Free Software Foundation, either version 3 of the License, or (at your
9 (at your option) any later version. 10 * option) any later version.
10 11 *
11 This program is distributed in the hope that it will be useful, 12 * This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 15 * GNU General Public License for more details.
15 16 *
16 You should have received a copy of the GNU General Public License 17 * You should have received a copy of the Affero GNU General Public License
17 along with this program; if not, write to the Free Software 18 * and the GNU General Public License along with this program. If not, see
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * <http://www.gnu.org/licenses/>.
19 20 *
20 The author can be reached via e-mail to frankj@ifi.uio.no. 21 * The authors can be reached via e-mail to <support@deliantra.net>
21*/ 22 */
22 23
23#include <global.h> 24#include <global.h>
24 25
25/* 26/*
26 * Allocates a new objectlink structure, initialises it, and returns 27 * Allocates a new objectlink structure, initialises it, and returns
27 * a pointer to it. 28 * a pointer to it.
28 */ 29 */
29 30
30objectlink * 31objectlink *
31get_objectlink (void) 32get_objectlink ()
32{ 33{
33 objectlink *ol = new objectlink; 34 objectlink *ol = new objectlink;
34 35
35 ol->ob = 0; 36 ol->ob = 0;
36 ol->next = 0; 37 ol->next = 0;
38
37 return ol; 39 return ol;
38} 40}
39 41
40/* 42/*
41 * Allocates a new oblinkpt structure, initialises it, and returns 43 * Allocates a new oblinkpt structure, initialises it, and returns
42 * a pointer to it. 44 * a pointer to it.
43 */ 45 */
44 46
45oblinkpt * 47oblinkpt *
46get_objectlinkpt (void) 48get_objectlinkpt ()
47{ 49{
48 oblinkpt *obp = new oblinkpt; 50 oblinkpt *obp = new oblinkpt;
49 51
50 obp->link = 0; 52 obp->link = 0;
51 obp->next = 0; 53 obp->next = 0;
52 obp->value = 0; 54
53 return obp; 55 return obp;
54} 56}
55 57
56/* 58/*
57 * Recursively frees all objectlinks 59 * Recursively frees all objectlinks
58 */ 60 */
59 61
60void 62void
61free_objectlink (objectlink * ol) 63free_objectlink (objectlink *ol)
62{ 64{
63 if (ol->next) 65 if (ol->next)
64 free_objectlink (ol->next); 66 free_objectlink (ol->next);
65 67
66 delete ol; 68 delete ol;
79 if (obp->link) 81 if (obp->link)
80 free_objectlink (obp->link); 82 free_objectlink (obp->link);
81 83
82 delete obp; 84 delete obp;
83} 85}
86

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines