From 66b0280bb144528e98f59b3b7cf7aace6723dc9c Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 20 Jul 2024 08:19:44 -0400 Subject: FS#13445: Fix AI regression in Superdom (Uwe Schächterle) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fix in e72bae7c3ff was subtly wrong due to variable re-use. Change-Id: Ibad3ad675a70682580dda0e7b2097702aa880524 --- apps/plugins/superdom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c index 2af290bc23..10373e1cc9 100644 --- a/apps/plugins/superdom.c +++ b/apps/plugins/superdom.c @@ -1951,7 +1951,7 @@ static void computer_allocate(void) } if(superdom_settings.compdiff>=AI_BUILD_INDS_FARMS_LEVEL && compres.cash>=PRICE_FACTORY+100) { - int i = 0; + int cnt = 0; do { if(compres.farms=PRICE_FACTORY + 100 && i++ < 3); + } while(compres.cash>=PRICE_FACTORY + 100 && cnt++ < 3); } /* AI will buy nukes first if possible */ if(compres.cash > PRICE_NUKE + PRICE_TANK && superdom_settings.compdiff>=AI_BUILD_NUKES_LEVEL) -- cgit v1.2.3