Commit 489f0275 authored by Alexander Schuch's avatar Alexander Schuch
Browse files

Exit loop as soon as result cannot change anymore.

The default AI iterates over all own fleets when trying to find a target
planet which does not yet have an own incoming fleet. As soon as an own
incoming fleet is found, the loop can abort as checking the remaining
fleets won't change the result anymore.
parent 285d5ea5
......@@ -80,6 +80,7 @@ void AiDefault::play()
foreach (AttackFleet *curFleet, attackList()) {
if (curFleet->destination == attack) {
skip = true;
break;
}
}
if (skip)
......@@ -109,6 +110,7 @@ void AiDefault::play()
foreach (AttackFleet *curFleet, attackList()) {
if (curFleet->destination == attack) {
skip = true;
break;
}
}
if (skip)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment