familiar crap.

This commit is contained in:
Enno Rehling 2006-04-22 21:45:59 +00:00
parent 722e66be41
commit d8a89d7630
1 changed files with 15 additions and 20 deletions

View File

@ -2177,19 +2177,14 @@ create_newfamiliar(unit * mage, unit * familiar)
attrib *afam = a_find(mage->attribs, &at_familiar); attrib *afam = a_find(mage->attribs, &at_familiar);
attrib *amage = a_find(familiar->attribs, &at_familiarmage); attrib *amage = a_find(familiar->attribs, &at_familiarmage);
if ((afam==NULL || afam->data.v==NULL) && (amage==NULL || amage->data.v==NULL)) { if (afam==NULL) {
afam = a_add(&mage->attribs, a_new(&at_familiar)); afam = a_add(&mage->attribs, a_new(&at_familiar));
}
afam->data.v = familiar; afam->data.v = familiar;
if (amage==NULL) {
amage = a_add(&familiar->attribs, a_new(&at_familiarmage)); amage = a_add(&familiar->attribs, a_new(&at_familiarmage));
}
amage->data.v = mage; amage->data.v = mage;
} else {
assert(afam->data.v == familiar);
assert(amage->data.v == mage);
if (afam->data.v != familiar || amage->data.v != mage) {
return false;
}
}
/* TODO: Diese Attribute beim Tod des Familiars entfernen: */ /* TODO: Diese Attribute beim Tod des Familiars entfernen: */
/* Wenn der Magier stirbt, dann auch der Vertraute */ /* Wenn der Magier stirbt, dann auch der Vertraute */