mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
[Superdom] Bugfix
Prevents the plugin from locking up on the highest difficulty level Change-Id: I07ab77e825935948b2d15ca6d36ad24b2716ac1b
This commit is contained in:
parent
4e54443dc9
commit
e72bae7c3f
1 changed files with 14 additions and 19 deletions
|
@ -1941,13 +1941,12 @@ static void computer_allocate(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
if(superdom_settings.compdiff>=AI_BUILD_INDS_FARMS_LEVEL && compres.cash>=PRICE_FACTORY)
|
||||
if(superdom_settings.compdiff>=AI_BUILD_INDS_FARMS_LEVEL && compres.cash>=PRICE_FACTORY+100)
|
||||
{
|
||||
while(compres.cash>=PRICE_FACTORY)
|
||||
int i = 0;
|
||||
do
|
||||
{
|
||||
if(compres.farms<compres.inds)
|
||||
{
|
||||
while(compres.farms<compres.inds && compres.cash>=PRICE_FARM)
|
||||
{
|
||||
i = rb->rand()%BOARD_SIZE + 1;
|
||||
j = rb->rand()%BOARD_SIZE + 1;
|
||||
|
@ -1957,10 +1956,7 @@ static void computer_allocate(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(compres.inds<compres.farms && compres.cash>=PRICE_FACTORY)
|
||||
{
|
||||
i = rb->rand()%BOARD_SIZE + 1;
|
||||
j = rb->rand()%BOARD_SIZE + 1;
|
||||
|
@ -1970,8 +1966,7 @@ static void computer_allocate(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} while(compres.cash>=PRICE_FACTORY + 100 && i++ < 3);
|
||||
}
|
||||
/* AI will buy nukes first if possible */
|
||||
if(compres.cash > PRICE_NUKE + PRICE_TANK && superdom_settings.compdiff>=AI_BUILD_NUKES_LEVEL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue