Skip to content

Commit

Permalink
Feature: Make large UFO destination a bit more random
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddi-z committed Oct 11, 2022
1 parent 3e86f33 commit 8e245ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/disaster_vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,11 @@ static bool DisasterTick_Big_Ufo(DisasterVehicle *v)

TileIndex tile_org = RandomTile();
TileIndex tile = tile_org;
int num = GB(Random(), 0, 8);
do {
if (IsPlainRailTile(tile) &&
Company::IsHumanID(GetTileOwner(tile))) {
break;
if (--num == 0) break;
}
tile = TILE_MASK(tile + 1);
} while (tile != tile_org);
Expand Down

0 comments on commit 8e245ca

Please sign in to comment.