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; const char *pzTmp;
spell *sp; spell *sp;
building * b; building * b;
boolean itemcloak = is_cursed(u->attribs, C_ITEMCLOAK, 0);
boolean isbattle = (boolean)(mode == see_battle); boolean isbattle = (boolean)(mode == see_battle);
int telepath_see = fspecial(f, FS_TELEPATHY); int telepath_see = fspecial(f, FS_TELEPATHY);
attrib *a_fshidden = NULL; attrib *a_fshidden = NULL;
@ -198,6 +197,17 @@ bufunit(const faction * f, const unit * u, int indent, int mode)
item * show; item * show;
faction *fv = visible_faction(f, u); faction *fv = visible_faction(f, u);
char * bufp = buf; 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)) if (fspecial(u->faction, FS_HIDDEN))
a_fshidden = a_find(u->attribs, &at_fshidden); 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); int getarnt = fval(u, UFL_PARTEITARNUNG);
faction *fv; faction *fv;
const char *pzTmp; const char *pzTmp;
boolean itemcloak = is_cursed(u->attribs, C_ITEMCLOAK, 0);
attrib *a_fshidden = NULL; attrib *a_fshidden = NULL;
item * itm; item * itm;
item * show; item * show;
ugroup *ug = findugroup(u); ugroup *ug = findugroup(u);
boolean guards = false; boolean guards = false;
boolean sieges = 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)) if(fspecial(u->faction, FS_HIDDEN))
a_fshidden = a_find(u->attribs, &at_fshidden); 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_strings);
xml_register_callback(parse_prefixes); 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_races);
xml_register_callback(parse_resources); xml_register_callback(parse_resources);