diff --git a/src/battle/ai.c b/src/battle/ai.c index 5215121..86ea420 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -65,6 +65,11 @@ void doAI(void) deployMine(); } + if ((self->aiFlags & AIF_SURRENDERS) && (battle.stats[STAT_TIME] % 6 == 0) && isSurrendering()) + { + return; + } + if ((self->aiFlags & (AIF_AVOIDS_COMBAT | AIF_EVADE)) && nearEnemies()) { return; @@ -107,11 +112,6 @@ void doAI(void) return; } - if ((self->aiFlags & AIF_SURRENDERS) && (battle.stats[STAT_TIME] % 6 == 0) && isSurrendering()) - { - return; - } - if (!(self->aiFlags & AIF_AVOIDS_COMBAT)) { if (self->speed) @@ -605,7 +605,7 @@ static int isSurrendering(void) { chance = self->health; chance /= self->maxHealth; - chance *= 75; + chance *= 100; if (rand() % 100 > chance) {