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

Comparing deliantra/server/common/recipe.C (file contents):
Revision 1.10 by elmex, Thu Dec 14 00:08:52 2006 UTC vs.
Revision 1.12 by pippijn, Tue Jan 2 23:39:21 2007 UTC

16 * chance 10 16 * chance 10
17 * ingred dust of beholdereye,gem 17 * ingred dust of beholdereye,gem
18 * arch potion_generic 18 * arch potion_generic
19 */ 19 */
20 20
21#include <cctype>
22
21#include <global.h> 23#include <global.h>
22#include <object.h> 24#include <object.h>
23#include <ctype.h>
24 25
25static void build_stringlist (const char *str, char ***result_list, size_t * result_size); 26static void build_stringlist (const char *str, char ***result_list, size_t * result_size);
26 27
27static recipelist *formulalist; 28static recipelist *formulalist;
28 29
93 { 94 {
94 artifact *art = locate_recipe_artifact (rp, i); 95 artifact *art = locate_recipe_artifact (rp, i);
95 96
96 if (!art && strcmp (rp->title, "NONE") != 0) 97 if (!art && strcmp (rp->title, "NONE") != 0)
97 { 98 {
98 LOG (llevError, "\nWARNING: Formula %s of %s has no artifact.\n", rp->arch_name[i], &rp->title); 99 LOG (llevError, "WARNING: Formula %s of %s has no artifact.\n", rp->arch_name[i], &rp->title);
99 result = 0; 100 result = 0;
100 } 101 }
101 } 102 }
102 else 103 else
103 { 104 {
104 LOG (llevError, "\nWARNING: Can't find archetype %s for formula %s\n", rp->arch_name[i], &rp->title); 105 LOG (llevError, "WARNING: Can't find archetype %s for formula %s\n", rp->arch_name[i], &rp->title);
105 result = 0; 106 result = 0;
106 } 107 }
107 } 108 }
108 109
109 return result; 110 return result;
133 return; 134 return;
134 else 135 else
135 has_been_done = 1; 136 has_been_done = 1;
136 137
137 sprintf (filename, "%s/formulae", settings.datadir); 138 sprintf (filename, "%s/formulae", settings.datadir);
138 LOG (llevDebug, "Reading alchemical formulae from %s...", filename); 139 LOG (llevDebug, "Reading alchemical formulae from %s...\n", filename);
139 if ((fp = open_and_uncompress (filename, 0, &comp)) == NULL) 140 if ((fp = open_and_uncompress (filename, 0, &comp)) == NULL)
140 { 141 {
141 LOG (llevError, "Can't open %s.\n", filename); 142 LOG (llevError, "Can't open %s.\n", filename);
142 return; 143 return;
143 } 144 }
743 char *dup; 744 char *dup;
744 char *p; 745 char *p;
745 size_t size; 746 size_t size;
746 size_t i; 747 size_t i;
747 748
748 dup = strdup_local (str); 749 dup = strdup (str);
749 if (dup == NULL) 750 if (dup == NULL)
750 fatal (OUT_OF_MEMORY); 751 fatal (OUT_OF_MEMORY);
751 752
752 size = 0; 753 size = 0;
753 for (p = strtok (dup, ","); p != NULL; p = strtok (NULL, ",")) 754 for (p = strtok (dup, ","); p != NULL; p = strtok (NULL, ","))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines