diff --git a/res/eressea/spells.xml b/res/eressea/spells.xml index 2adc132e5..859dea5bb 100644 --- a/res/eressea/spells.xml +++ b/res/eressea/spells.xml @@ -411,10 +411,10 @@ - + - + diff --git a/src/magic.c b/src/magic.c index e6bb36002..1b41b87af 100644 --- a/src/magic.c +++ b/src/magic.c @@ -1475,7 +1475,7 @@ verify_ship(region * r, unit * mage, const spell * sp, spllprm * spobj, { ship *sh = findship(spobj->data.i); - if (sh != NULL && sh->region != r && (sp->sptyp & SEARCHLOCAL)) { + if (sh != NULL && sh->region != r && (sp->sptyp & GLOBALTARGET) == 0) { /* Burg muss in gleicher Region sein */ sh = NULL; } @@ -1498,7 +1498,7 @@ verify_building(region * r, unit * mage, const spell * sp, spllprm * spobj, { building *b = findbuilding(spobj->data.i); - if (b != NULL && b->region != r && (sp->sptyp & SEARCHLOCAL)) { + if (b != NULL && b->region != r && (sp->sptyp & GLOBALTARGET) == 0) { /* Burg muss in gleicher Region sein */ b = NULL; } @@ -1552,14 +1552,15 @@ verify_unit(region * r, unit * mage, const spell * sp, spllprm * spobj, default: assert(!"shouldn't happen, this"); } - if (u != NULL && (sp->sptyp & SEARCHLOCAL)) { - if (u->region != r) - u = NULL; - else if (sp->sptyp & TESTCANSEE) { + if (u != NULL) { + if (u->region == r) { if (!cansee(mage->faction, r, u, 0) && !ucontact(u, mage)) { u = NULL; } } + else if ((sp->sptyp & GLOBALTARGET) == 0) { + u = NULL; + } } if (u == NULL) { diff --git a/src/magic.h b/src/magic.h index ae43fd5af..9118a546b 100644 --- a/src/magic.h +++ b/src/magic.h @@ -174,7 +174,7 @@ extern "C" { #define NOTFAMILIARCAST (1<<12) #define TESTRESISTANCE (1<<13) /* alle Zielobjekte (u, s, b, r) auf Magieresistenz prüfen */ -#define SEARCHLOCAL (1<<14) /* Ziel muss in der target_region sein */ +#define GLOBALTARGET (1<<14) /* Ziel muss in der target_region sein */ #define TESTCANSEE (1<<15) /* alle Zielunits auf cansee prüfen */ #define ANYTARGET (UNITSPELL|REGIONSPELL|BUILDINGSPELL|SHIPSPELL) /* wirkt auf alle objekttypen (unit, ship, building, region) */ diff --git a/src/xmlreader.c b/src/xmlreader.c index dcf51707b..35b4b328e 100644 --- a/src/xmlreader.c +++ b/src/xmlreader.c @@ -1169,8 +1169,6 @@ static int parse_spells(xmlDocPtr doc) sp->rank = (char)xml_ivalue(node, "rank", 0); if (xml_bvalue(node, "los", false)) sp->sptyp |= TESTCANSEE; /* must see or have contact */ - if (!xml_bvalue(node, "target_global", false)) - sp->sptyp |= SEARCHLOCAL; /* must be in same region */ if (xml_bvalue(node, "ship", false)) sp->sptyp |= ONSHIPCAST; if (xml_bvalue(node, "ocean", false)) @@ -1180,6 +1178,8 @@ static int parse_spells(xmlDocPtr doc) if (xml_bvalue(node, "variable", false)) sp->sptyp |= SPELLLEVEL; + if (xml_bvalue(node, "globaltarget", false)) + sp->sptyp |= GLOBALTARGET; /* target need not be in same region */ if (xml_bvalue(node, "buildingtarget", false)) sp->sptyp |= BUILDINGSPELL; if (xml_bvalue(node, "shiptarget", false))