forked from github/server
keyword lookup macro
This commit is contained in:
parent
5c78a3883e
commit
0675c50c7f
|
@ -53,8 +53,6 @@
|
|||
<game name="Eressea">
|
||||
<!-- Game specific settings -->
|
||||
|
||||
<order name="BEZAHLEN" disable="yes"/>
|
||||
|
||||
<skill name="alchemy" enable="true"/>
|
||||
<skill name="crossbow" enable="true"/>
|
||||
<skill name="mining" enable="true"/>
|
||||
|
|
|
@ -413,8 +413,7 @@ const char *options[MAXOPTIONS] = {
|
|||
"ADRESSEN",
|
||||
"BZIP2",
|
||||
"PUNKTE",
|
||||
"SHOWSKCHANGE",
|
||||
"XML"
|
||||
"SHOWSKCHANGE"
|
||||
};
|
||||
|
||||
static int allied_skillcount(const faction * f, skill_t sk)
|
||||
|
|
|
@ -2399,7 +2399,7 @@ static int hunt(unit * u, order * ord)
|
|||
}
|
||||
|
||||
bufp = command;
|
||||
bytes = slprintf(bufp, size, "%s %s", LOC(u->faction->locale, keywords[K_MOVE]), LOC(u->faction->locale, directions[dir]));
|
||||
bytes = slprintf(bufp, size, "%s %s", LOC(u->faction->locale, keyword(K_MOVE)), LOC(u->faction->locale, directions[dir]));
|
||||
if (wrptr(&bufp, &size, bytes) != 0)
|
||||
WARN_STATIC_BUFFER();
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ static char* get_command(const order *ord, char *sbuffer, size_t size) {
|
|||
if (kwd != NOKEYWORD) {
|
||||
const struct locale *lang = ORD_LOCALE(ord);
|
||||
if (size > 0) {
|
||||
const char *str = (const char *)LOC(lang, mkname("keyword", keywords[kwd]));
|
||||
const char *str = (const char *)LOC(lang, keyword(kwd));
|
||||
assert(str);
|
||||
if (text) --size;
|
||||
bytes = (int)strlcpy(bufp, str, size);
|
||||
|
|
|
@ -183,7 +183,6 @@ enum {
|
|||
O_BZIP2, /* 1024 - compress as bzip2 */
|
||||
O_SCORE, /* 2048 - punkte anzeigen? */
|
||||
O_SHOWSKCHANGE, /* 4096 - Skillveränderungen anzeigen? */
|
||||
O_XML, /* 8192 - XML report versenden */
|
||||
MAXOPTIONS
|
||||
};
|
||||
|
||||
|
|
|
@ -80,6 +80,8 @@ void init_keywords(const struct locale *lang);
|
|||
void init_keyword(const struct locale *lang, keyword_t kwd, const char *str);
|
||||
bool keyword_disabled(keyword_t kwd);
|
||||
void enable_keyword(keyword_t kwd, bool enabled);
|
||||
#define keyword(kwd) mkname("keyword", keywords[kwd])
|
||||
|
||||
#ifdef __cplusplus
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -445,7 +445,7 @@ static order *make_movement_order(unit * u, const region * target, int moves,
|
|||
|
||||
bytes =
|
||||
(int)strlcpy(bufp,
|
||||
(const char *)LOC(u->faction->locale, keywords[K_MOVE]), size);
|
||||
(const char *)LOC(u->faction->locale, keyword(K_MOVE)), size);
|
||||
if (wrptr(&bufp, &size, bytes) != 0)
|
||||
WARN_STATIC_BUFFER();
|
||||
|
||||
|
|
|
@ -336,9 +336,9 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
|
|||
size = sizeof(buf) - 1;
|
||||
|
||||
if (sp->sptyp & ISCOMBATSPELL) {
|
||||
bytes = (int)strlcpy(bufp, LOC(lang, keywords[K_COMBATSPELL]), size);
|
||||
bytes = (int)strlcpy(bufp, LOC(lang, keyword(K_COMBATSPELL)), size);
|
||||
} else {
|
||||
bytes = (int)strlcpy(bufp, LOC(lang, keywords[K_CAST]), size);
|
||||
bytes = (int)strlcpy(bufp, LOC(lang, keyword(K_CAST)), size);
|
||||
}
|
||||
if (wrptr(&bufp, &size, bytes) != 0)
|
||||
WARN_STATIC_BUFFER();
|
||||
|
|
Loading…
Reference in New Issue