From 7ad836e8e4f5c400e5306b55033c5a874fd8c63e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 22 May 2005 21:02:42 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/view.php?id=522 LERNEN Magie hat einen optionalen Parameter, was ich vergessen hatte. --- src/common/kernel/order.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/common/kernel/order.c b/src/common/kernel/order.c index e896130b6..f26011691 100644 --- a/src/common/kernel/order.c +++ b/src/common/kernel/order.c @@ -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 */ if (kwd==K_STUDY) { skill_t sk = findskill(parse_token(&sptr), lang); - if (sk!=NOSKILL) { - data = locale_array[lindex]->study_orders[sk]; - if (data==NULL) { - data = (order_data*)malloc(sizeof(order_data)); - locale_array[lindex]->study_orders[sk] = data; - data->_keyword = kwd; - data->_lindex = lindex; + switch (sk) { + case NOSKILL: /* fehler */ + case SK_MAGIC: /* kann parameter haben */ + break; + default: /* nur skill als Parameter, keine extras */ + data = locale_array[lindex]->study_orders[sk]; + 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 - data->_str = strdup(skillname(sk, lang)); + data->_str = strdup(skillname(sk, lang)); #else - sprintf(buf, "%s %s", LOC(lang, keywords[kwd]), skillname(sk, lang)); - data->_str = strdup(buf); + sprintf(buf, "%s %s", LOC(lang, keywords[kwd]), skillname(sk, lang)); + data->_str = strdup(buf); #endif - data->_refcount = 1; - } - ++data->_refcount; - return data; + data->_refcount = 1; + } + ++data->_refcount; + return data; } }