diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-07-20 08:19:44 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-07-20 08:25:05 -0400 |
commit | 66b0280bb144528e98f59b3b7cf7aace6723dc9c (patch) | |
tree | e800e560126dc91d1998eab4de5bf7fafaa5d318 /apps/plugins | |
parent | f24271c73c32f0bb9443819de643574891ecd5ba (diff) | |
download | rockbox-66b0280bb144528e98f59b3b7cf7aace6723dc9c.tar.gz rockbox-66b0280bb144528e98f59b3b7cf7aace6723dc9c.zip |
FS#13445: Fix AI regression in Superdom (Uwe Schächterle)
The fix in e72bae7c3ff was subtly wrong due to variable re-use.
Change-Id: Ibad3ad675a70682580dda0e7b2097702aa880524
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/superdom.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
1951 | } | 1951 | } |
1952 | if(superdom_settings.compdiff>=AI_BUILD_INDS_FARMS_LEVEL && compres.cash>=PRICE_FACTORY+100) | 1952 | if(superdom_settings.compdiff>=AI_BUILD_INDS_FARMS_LEVEL && compres.cash>=PRICE_FACTORY+100) |
1953 | { | 1953 | { |
1954 | int i = 0; | 1954 | int cnt = 0; |
1955 | do | 1955 | do |
1956 | { | 1956 | { |
1957 | if(compres.farms<compres.inds) | 1957 | if(compres.farms<compres.inds) |
@@ -1974,7 +1974,7 @@ static void computer_allocate(void) | |||
1974 | break; | 1974 | break; |
1975 | } | 1975 | } |
1976 | } | 1976 | } |
1977 | } while(compres.cash>=PRICE_FACTORY + 100 && i++ < 3); | 1977 | } while(compres.cash>=PRICE_FACTORY + 100 && cnt++ < 3); |
1978 | } | 1978 | } |
1979 | /* AI will buy nukes first if possible */ | 1979 | /* AI will buy nukes first if possible */ |
1980 | if(compres.cash > PRICE_NUKE + PRICE_TANK && superdom_settings.compdiff>=AI_BUILD_NUKES_LEVEL) | 1980 | if(compres.cash > PRICE_NUKE + PRICE_TANK && superdom_settings.compdiff>=AI_BUILD_NUKES_LEVEL) |