forked from github/server
- Vertraute haben keine Zauber, korrektur-routine.
This commit is contained in:
parent
6ed9ea2a9b
commit
d598babbb1
|
@ -40,6 +40,7 @@
|
||||||
#include <kernel/border.h>
|
#include <kernel/border.h>
|
||||||
#include <kernel/building.h>
|
#include <kernel/building.h>
|
||||||
#include <kernel/calendar.h>
|
#include <kernel/calendar.h>
|
||||||
|
#include <kernel/equipment.h>
|
||||||
#include <kernel/faction.h>
|
#include <kernel/faction.h>
|
||||||
#include <kernel/item.h>
|
#include <kernel/item.h>
|
||||||
#include <kernel/magic.h>
|
#include <kernel/magic.h>
|
||||||
|
@ -836,6 +837,9 @@ fix_familiars(void)
|
||||||
if (u->race->init_familiar && u->race->maintenance==0) {
|
if (u->race->init_familiar && u->race->maintenance==0) {
|
||||||
/* this is a familiar */
|
/* this is a familiar */
|
||||||
unit * mage = get_familiar_mage(u);
|
unit * mage = get_familiar_mage(u);
|
||||||
|
equipment * eq;
|
||||||
|
char fname[64];
|
||||||
|
|
||||||
if (mage==0) {
|
if (mage==0) {
|
||||||
log_error(("%s is a %s familiar with no mage for faction %s\n",
|
log_error(("%s is a %s familiar with no mage for faction %s\n",
|
||||||
unitid(u), racename(lang, u, u->race),
|
unitid(u), racename(lang, u, u->race),
|
||||||
|
@ -846,8 +850,30 @@ fix_familiars(void)
|
||||||
factionid(u->faction)));
|
factionid(u->faction)));
|
||||||
}
|
}
|
||||||
if (has_skill(u, SK_MAGIC) && !is_mage(u)) {
|
if (has_skill(u, SK_MAGIC) && !is_mage(u)) {
|
||||||
|
log_error(("%s is a familiar with magic skill, but did not have a mage-attribute\n",
|
||||||
|
unitid(u)));
|
||||||
create_mage(u, M_GRAU);
|
create_mage(u, M_GRAU);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(fname, sizeof(fname), "initfamiliar_%s", u->race->_name[0]);
|
||||||
|
eq = get_equipment(fname);
|
||||||
|
if (eq) {
|
||||||
|
spell_list * sp = eq->spells;
|
||||||
|
|
||||||
|
if (sp!=NULL) {
|
||||||
|
sc_mage * m = get_mage(u);
|
||||||
|
if (m==NULL) {
|
||||||
|
log_error(("%s is a %s-familiar with spells, but did not have a mage-attribute\n",
|
||||||
|
unitid(u), racename(lang, u, u->race)));
|
||||||
|
create_mage(u, M_GRAU);
|
||||||
|
} else {
|
||||||
|
while (sp) {
|
||||||
|
add_spell(m, sp->data);
|
||||||
|
sp = sp->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue