mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-02 09:40:35 +00:00
(svn r9251) -Fix(r6057, FS#644): Use a less CPU-intensive algorithm to find a random industry for the AI to prevent it slowing down the game. The AI now sucks a even a bit more than before (if that's even possible).
This commit is contained in:
parent
50811a49ed
commit
045d3dc05f
@ -460,7 +460,10 @@ static Town *AiFindRandomTown()
|
||||
|
||||
static Industry *AiFindRandomIndustry()
|
||||
{
|
||||
return GetRandomIndustry();
|
||||
int num = RandomRange(GetMaxIndustryIndex());
|
||||
if (IsValidIndustry(GetIndustry(num))) return GetIndustry(num);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void AiFindSubsidyIndustryRoute(FoundRoute *fr)
|
||||
|
Loading…
Reference in New Issue
Block a user