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

Comparing deliantra/server/server/egoitem.C (file contents):
Revision 1.4 by root, Tue Dec 26 08:54:59 2006 UTC vs.
Revision 1.5 by root, Mon Apr 16 06:23:42 2007 UTC

5 * the artifact could be created. 5 * the artifact could be created.
6 */ 6 */
7int 7int
8create_artifact (object *op, const char *artifactname) 8create_artifact (object *op, const char *artifactname)
9{ 9{
10 artifactlist *al; 10 if (artifactlist *al = find_artifactlist (op->type))
11 artifact *art; 11 for (artifact *art = al->items; art; art = art->next)
12 char *temptitle; 12 {
13 char *temptitle = (char *)(malloc (strlen (art->item->name) + 5));
14 strcpy (temptitle, " of ");
15 strcat (temptitle, art->item->name);
13 16
14 al = find_artifactlist (op->type);
15 if (al == NULL)
16 return 0;
17 for (art = al->items; art != NULL; art = art->next)
18 {
19 temptitle = (char *) (malloc (strlen (art->item->name) + 5));
20 strcpy (temptitle, " of ");
21 strcat (temptitle, art->item->name);
22 if (!strcmp (temptitle, artifactname)) 17 if (!strcmp (temptitle, artifactname))
23 { 18 {
19 free (temptitle);
24 give_artifact_abilities (op, art->item); 20 give_artifact_abilities (op, art->item);
25 free (temptitle);
26 return 1; 21 return 1;
27 } 22 }
28 23
29 free (temptitle); 24 free (temptitle);
30 }; 25 };
26
31 return 0; 27 return 0;
32} 28}
33 29
34/* peterm: do_power_crystal 30/* peterm: do_power_crystal
35 31

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines