Summon Igjarjuk only at the start of a battle, not after.

This commit is contained in:
Enno Rehling 2015-08-30 23:15:04 +02:00
parent acb2aed30f
commit 8c860811e2
1 changed files with 26 additions and 24 deletions

View File

@ -1696,34 +1696,36 @@ void do_combatmagic(battle * b, combatmagic_t was)
memset(spellranks, 0, sizeof(spellranks)); memset(spellranks, 0, sizeof(spellranks));
#ifdef FFL_CURSED #ifdef FFL_CURSED
for (s = b->sides; s != b->sides + b->nsides; ++s) { if (was == DO_PRECOMBATSPELL) {
fighter *fig = 0; for (s = b->sides; s != b->sides + b->nsides; ++s) {
if (s->bf->attacker) { fighter *fig = 0;
spell *sp = find_spell("igjarjuk"); if (s->bf->attacker) {
if (sp && fval(s->faction, FFL_CURSED)) { spell *sp = find_spell("igjarjuk");
int si; if (sp && fval(s->faction, FFL_CURSED)) {
for (si = 0; s->enemies[si]; ++si) { int si;
side *se = s->enemies[si]; for (si = 0; s->enemies[si]; ++si) {
if (se && !fval(se->faction, FFL_NPC)) { side *se = s->enemies[si];
fighter *fi; if (se && !fval(se->faction, FFL_NPC)) {
for (fi = se->fighters; fi; fi = fi->next) { fighter *fi;
if (fi && (!fig || fig->unit->number > fi->unit->number)) { for (fi = se->fighters; fi; fi = fi->next) {
fig = fi; if (fi && (!fig || fig->unit->number > fi->unit->number)) {
if (fig->unit->number == 1) { fig = fi;
break; if (fig->unit->number == 1) {
break;
}
} }
} }
} if (fig && fig->unit->number == 1) {
if (fig && fig->unit->number == 1) { break;
break; }
} }
} }
} if (fig) {
if (fig) { co = create_castorder_combat(0, fig, sp, 10, 10);
co = create_castorder_combat(0, fig, sp, 10, 10); co->magician.fig = fig;
co->magician.fig = fig; add_castorder(&spellranks[sp->rank], co);
add_castorder(&spellranks[sp->rank], co); break;
break; }
} }
} }
} }