messages müssen für den mapper nicht registriert werden.

itemcloak cursetype kann in einer static-variablen gehalten werden.
This commit is contained in:
Enno Rehling 2005-06-13 20:28:27 +00:00
parent 686dfacc02
commit 4d0cfa34fa
2 changed files with 25 additions and 3 deletions

View File

@ -190,7 +190,6 @@ bufunit(const faction * f, const unit * u, int indent, int mode)
const char *pzTmp;
spell *sp;
building * b;
boolean itemcloak = is_cursed(u->attribs, C_ITEMCLOAK, 0);
boolean isbattle = (boolean)(mode == see_battle);
int telepath_see = fspecial(f, FS_TELEPATHY);
attrib *a_fshidden = NULL;
@ -198,6 +197,17 @@ bufunit(const faction * f, const unit * u, int indent, int mode)
item * show;
faction *fv = visible_faction(f, u);
char * bufp = buf;
boolean itemcloak = false;
static const curse_type * itemcloak_ct = 0;
static boolean init = false;
if (!init) {
init = true;
itemcloak_ct = ct_find("itemcloak");
}
if (itemcloak_ct!=NULL) {
itemcloak = curse_active(get_curse(u->attribs, itemcloak_ct));
}
if (fspecial(u->faction, FS_HIDDEN))
a_fshidden = a_find(u->attribs, &at_fshidden);
@ -491,13 +501,23 @@ bufunit_ugroupleader(const faction * f, const unit * u, int indent, int mode)
int getarnt = fval(u, UFL_PARTEITARNUNG);
faction *fv;
const char *pzTmp;
boolean itemcloak = is_cursed(u->attribs, C_ITEMCLOAK, 0);
attrib *a_fshidden = NULL;
item * itm;
item * show;
ugroup *ug = findugroup(u);
boolean guards = false;
boolean sieges = false;
boolean itemcloak = false;
static const curse_type * itemcloak_ct = 0;
static boolean init = false;
if (!init) {
init = true;
itemcloak_ct = ct_find("itemcloak");
}
if (itemcloak_ct!=NULL) {
itemcloak = curse_active(get_curse(u->attribs, itemcloak_ct));
}
if(fspecial(u->faction, FS_HIDDEN))
a_fshidden = a_find(u->attribs, &at_fshidden);

View File

@ -1356,7 +1356,9 @@ register_xmlreader(void)
xml_register_callback(parse_strings);
xml_register_callback(parse_prefixes);
xml_register_callback(parse_messages);
if (gamecode_enabled) {
xml_register_callback(parse_messages);
}
xml_register_callback(parse_races);
xml_register_callback(parse_resources);