1
0
Fork 0
forked from len0rd/rockbox

[Superdom] Bugfix

Prevents the plugin from locking up on the highest difficulty level

Change-Id: I07ab77e825935948b2d15ca6d36ad24b2716ac1b
This commit is contained in:
Franklin Wei 2015-08-14 22:11:06 -04:00 committed by Solomon Peachy
parent 4e54443dc9
commit e72bae7c3f

View file

@ -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)