LERNEN Magie hat einen optionalen Parameter, was ich vergessen hatte.
This commit is contained in:
Enno Rehling 2005-05-22 21:02:42 +00:00
parent c55a10db06
commit 7ad836e8e4

View file

@ -179,23 +179,27 @@ create_data(keyword_t kwd, const char * s, const char * sptr, int lindex)
/* learning, only one order_data per skill required */ /* learning, only one order_data per skill required */
if (kwd==K_STUDY) { if (kwd==K_STUDY) {
skill_t sk = findskill(parse_token(&sptr), lang); skill_t sk = findskill(parse_token(&sptr), lang);
if (sk!=NOSKILL) { switch (sk) {
data = locale_array[lindex]->study_orders[sk]; case NOSKILL: /* fehler */
if (data==NULL) { case SK_MAGIC: /* kann parameter haben */
data = (order_data*)malloc(sizeof(order_data)); break;
locale_array[lindex]->study_orders[sk] = data; default: /* nur skill als Parameter, keine extras */
data->_keyword = kwd; data = locale_array[lindex]->study_orders[sk];
data->_lindex = lindex; if (data==NULL) {
data = (order_data*)malloc(sizeof(order_data));
locale_array[lindex]->study_orders[sk] = data;
data->_keyword = kwd;
data->_lindex = lindex;
#ifdef SHORT_STRINGS #ifdef SHORT_STRINGS
data->_str = strdup(skillname(sk, lang)); data->_str = strdup(skillname(sk, lang));
#else #else
sprintf(buf, "%s %s", LOC(lang, keywords[kwd]), skillname(sk, lang)); sprintf(buf, "%s %s", LOC(lang, keywords[kwd]), skillname(sk, lang));
data->_str = strdup(buf); data->_str = strdup(buf);
#endif #endif
data->_refcount = 1; data->_refcount = 1;
} }
++data->_refcount; ++data->_refcount;
return data; return data;
} }
} }