forked from github/server
kill ATF_CURSE flag, compare to at_curse directly.
This commit is contained in:
parent
612cd1158a
commit
f4df6bd9db
|
@ -254,7 +254,7 @@ cr_output_curses(struct stream *out, const faction * viewer, const void *obj, ob
|
||||||
}
|
}
|
||||||
|
|
||||||
while (a) {
|
while (a) {
|
||||||
if (fval(a->type, ATF_CURSE)) {
|
if (a->type == &at_curse) {
|
||||||
curse *c = (curse *)a->data.v;
|
curse *c = (curse *)a->data.v;
|
||||||
message *msg;
|
message *msg;
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ struct order *ord)
|
||||||
while (*ap && force > 0) {
|
while (*ap && force > 0) {
|
||||||
curse *c;
|
curse *c;
|
||||||
attrib *a = *ap;
|
attrib *a = *ap;
|
||||||
if (!(a->type->flags & ATF_CURSE)) {
|
if (a->type != &at_curse) {
|
||||||
do {
|
do {
|
||||||
ap = &(*ap)->next;
|
ap = &(*ap)->next;
|
||||||
} while (*ap && a->type == (*ap)->type);
|
} while (*ap && a->type == (*ap)->type);
|
||||||
|
|
|
@ -273,8 +273,7 @@ attrib_type at_curse = {
|
||||||
curse_age,
|
curse_age,
|
||||||
curse_write,
|
curse_write,
|
||||||
curse_read,
|
curse_read,
|
||||||
NULL,
|
NULL
|
||||||
ATF_CURSE
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
@ -363,7 +362,7 @@ void ct_checknames(void) {
|
||||||
static bool cmp_curse(const attrib * a, const void *data)
|
static bool cmp_curse(const attrib * a, const void *data)
|
||||||
{
|
{
|
||||||
const curse *c = (const curse *)data;
|
const curse *c = (const curse *)data;
|
||||||
if (a->type->flags & ATF_CURSE) {
|
if (a->type == &at_curse) {
|
||||||
if (!data || c == (curse *)a->data.v)
|
if (!data || c == (curse *)a->data.v)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -375,7 +374,7 @@ curse *get_curse(attrib * ap, const curse_type * ctype)
|
||||||
attrib *a = ap;
|
attrib *a = ap;
|
||||||
if (!ctype) return NULL;
|
if (!ctype) return NULL;
|
||||||
while (a) {
|
while (a) {
|
||||||
if (a->type->flags & ATF_CURSE) {
|
if (a->type == &at_curse) {
|
||||||
const attrib_type *at = a->type;
|
const attrib_type *at = a->type;
|
||||||
while (a && a->type == at) {
|
while (a && a->type == at) {
|
||||||
curse *c = (curse *)a->data.v;
|
curse *c = (curse *)a->data.v;
|
||||||
|
@ -710,7 +709,7 @@ bool is_cursed_with(const attrib * ap, const curse * c)
|
||||||
const attrib *a = ap;
|
const attrib *a = ap;
|
||||||
|
|
||||||
while (a) {
|
while (a) {
|
||||||
if ((a->type->flags & ATF_CURSE) && (c == (const curse *)a->data.v)) {
|
if ((a->type == &at_curse) && (c == (const curse *)a->data.v)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
a = a->next;
|
a = a->next;
|
||||||
|
|
|
@ -311,9 +311,6 @@ extern "C" {
|
||||||
#define get_curseeffect(a, ctype) \
|
#define get_curseeffect(a, ctype) \
|
||||||
curse_geteffect(get_curse(a, ctype))
|
curse_geteffect(get_curse(a, ctype))
|
||||||
|
|
||||||
/* eressea-defined attribute-type flags */
|
|
||||||
#define ATF_CURSE ATF_USER_DEFINED
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -568,7 +568,7 @@ nr_curses_i(struct stream *out, int indent, const faction *viewer, objtype_t typ
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
message *msg = 0;
|
message *msg = 0;
|
||||||
|
|
||||||
if (fval(a->type, ATF_CURSE)) {
|
if (a->type == &at_curse) {
|
||||||
curse *c = (curse *)a->data.v;
|
curse *c = (curse *)a->data.v;
|
||||||
|
|
||||||
self = curse_cansee(c, viewer, typ, obj, self);
|
self = curse_cansee(c, viewer, typ, obj, self);
|
||||||
|
|
12
src/spells.c
12
src/spells.c
|
@ -144,7 +144,7 @@ static void magicanalyse_region(region * r, unit * mage, double force)
|
||||||
double probability;
|
double probability;
|
||||||
int mon;
|
int mon;
|
||||||
|
|
||||||
if (!fval(a->type, ATF_CURSE))
|
if (a->type != &at_curse)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* ist der curse schwaecher als der Analysezauber, so ergibt sich
|
/* ist der curse schwaecher als der Analysezauber, so ergibt sich
|
||||||
|
@ -184,7 +184,7 @@ static void magicanalyse_unit(unit * u, unit * mage, double force)
|
||||||
curse *c;
|
curse *c;
|
||||||
double probability;
|
double probability;
|
||||||
int mon;
|
int mon;
|
||||||
if (!fval(a->type, ATF_CURSE))
|
if (a->type != &at_curse)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
c = (curse *)a->data.v;
|
c = (curse *)a->data.v;
|
||||||
|
@ -225,7 +225,7 @@ static void magicanalyse_building(building * b, unit * mage, double force)
|
||||||
double probability;
|
double probability;
|
||||||
int mon;
|
int mon;
|
||||||
|
|
||||||
if (!fval(a->type, ATF_CURSE))
|
if (a->type != &at_curse)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
c = (curse *)a->data.v;
|
c = (curse *)a->data.v;
|
||||||
|
@ -266,7 +266,7 @@ static void magicanalyse_ship(ship * sh, unit * mage, double force)
|
||||||
curse *c;
|
curse *c;
|
||||||
double probability;
|
double probability;
|
||||||
int mon;
|
int mon;
|
||||||
if (!fval(a->type, ATF_CURSE))
|
if (a->type != &at_curse)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
c = (curse *)a->data.v;
|
c = (curse *)a->data.v;
|
||||||
|
@ -308,7 +308,7 @@ static int break_curse(attrib ** alist, int cast_level, double force, curse * c)
|
||||||
while (*ap && force > 0) {
|
while (*ap && force > 0) {
|
||||||
curse *c1;
|
curse *c1;
|
||||||
attrib *a = *ap;
|
attrib *a = *ap;
|
||||||
if (!fval(a->type, ATF_CURSE)) {
|
if (a->type != &at_curse) {
|
||||||
do {
|
do {
|
||||||
ap = &(*ap)->next;
|
ap = &(*ap)->next;
|
||||||
} while (*ap && a->type == (*ap)->type);
|
} while (*ap && a->type == (*ap)->type);
|
||||||
|
@ -2970,7 +2970,7 @@ static int sp_deathcloud(castorder * co)
|
||||||
unit *u;
|
unit *u;
|
||||||
|
|
||||||
while (a) {
|
while (a) {
|
||||||
if ((a->type->flags & ATF_CURSE)) {
|
if (a->type == &at_curse) {
|
||||||
curse *c = a->data.v;
|
curse *c = a->data.v;
|
||||||
if (c->type == &ct_deathcloud) {
|
if (c->type == &ct_deathcloud) {
|
||||||
report_failure(mage, co->order);
|
report_failure(mage, co->order);
|
||||||
|
|
Loading…
Reference in New Issue