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

Comparing deliantra/server/common/arch.C (file contents):
Revision 1.16 by root, Sun Sep 10 16:00:23 2006 UTC vs.
Revision 1.17 by root, Tue Sep 12 19:20:06 2006 UTC

1
2/*
3 * static char *rcsid_arch_c =
4 * "$Id: arch.C,v 1.16 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) 2002 Mark Wedel & Crossfire Development Team 4 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
11 Copyright (C) 1992 Frank Tore Johansen 5 Copyright (C) 1992 Frank Tore Johansen
173 * but it otherwise had a big memory leak. 167 * but it otherwise had a big memory leak.
174 */ 168 */
175object * 169object *
176get_archetype_by_object_name (const char *name) 170get_archetype_by_object_name (const char *name)
177{ 171{
178 archetype * 172 archetype *at;
179 at;
180 char
181 tmpname[MAX_BUF]; 173 char tmpname[MAX_BUF];
182 int 174 int i;
183 i;
184 175
185 strncpy (tmpname, name, MAX_BUF - 1); 176 assign (tmpname, name);
186 tmpname[MAX_BUF - 1] = 0; 177
187 for (i = strlen (tmpname); i > 0; i--) 178 for (i = strlen (tmpname); i > 0; i--)
188 { 179 {
189 tmpname[i] = 0; 180 tmpname[i] = 0;
190 at = find_archetype_by_object_name (tmpname); 181 at = find_archetype_by_object_name (tmpname);
182
191 if (at != NULL) 183 if (at != NULL)
192 { 184 {
193 return arch_to_object (at); 185 return arch_to_object (at);
194 } 186 }
195 } 187 }
188
196 return create_singularity (name); 189 return create_singularity (name);
197} 190}
198 191
199 /* This is a subset of the parse_id command. Basically, name can be 192 /* This is a subset of the parse_id command. Basically, name can be
200 * a string seperated lists of things to match, with certain keywords. 193 * a string seperated lists of things to match, with certain keywords.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines