(svn r2080) - Fix: [OldAI] p->ai.state_counter was uint16 but could hold a tile index, therefore overflowing - changed that to uint32 and bumped the savegame revision to 32. It *MIGHT* close bug 1151374 - it certainly caused AI to stop building anything sometimes.
- While at it, use TileIndex as the tile index type in AiRemovePlayerRailOrRoad() and AiStateRemoveTrack(). - Make the number of tiles scanned 4*MapSizeX() instead of 1000. It *MIGHT* close bug 1116614.
This commit is contained in:
7
ai.c
7
ai.c
@@ -3640,7 +3640,7 @@ static void AiStateRemoveStation(Player *p)
|
||||
|
||||
}
|
||||
|
||||
static void AiRemovePlayerRailOrRoad(Player *p, uint tile)
|
||||
static void AiRemovePlayerRailOrRoad(Player *p, TileIndex tile)
|
||||
{
|
||||
byte m5;
|
||||
|
||||
@@ -3758,10 +3758,11 @@ pos_3:
|
||||
|
||||
static void AiStateRemoveTrack(Player *p)
|
||||
{
|
||||
int num = 1000;
|
||||
/* Was 1000 for standard 8x8 maps. */
|
||||
int num = MapSizeX() * 4;
|
||||
|
||||
do {
|
||||
uint tile = ++p->ai.state_counter;
|
||||
TileIndex tile = ++p->ai.state_counter;
|
||||
|
||||
// Iterated all tiles?
|
||||
if (tile >= MapSize()) {
|
||||
|
||||
Reference in New Issue
Block a user