mirror of https://github.com/OpenTTD/OpenTTD
(svn r9817) -Fix [FS#772]: an assertion that was triggered by the AI building when its rating for the town was not high enough.
parent
2d86e87a3d
commit
f24f9d5a2e
|
@ -1792,17 +1792,15 @@ static void AiStateBuildDefaultRailBlocks(Player *p)
|
||||||
p->ai.state_mode = -p->ai.state_mode;
|
p->ai.state_mode = -p->ai.state_mode;
|
||||||
}
|
}
|
||||||
} else if (CheckPlayerHasMoney(cost)) {
|
} else if (CheckPlayerHasMoney(cost)) {
|
||||||
int32 r;
|
|
||||||
// player has money, build it.
|
// player has money, build it.
|
||||||
aib->cur_building_rule = rule;
|
aib->cur_building_rule = rule;
|
||||||
|
|
||||||
r = AiDoBuildDefaultRailTrack(
|
AiDoBuildDefaultRailTrack(
|
||||||
aib->use_tile,
|
aib->use_tile,
|
||||||
_default_rail_track_data[rule]->data,
|
_default_rail_track_data[rule]->data,
|
||||||
p->ai.railtype_to_use,
|
p->ai.railtype_to_use,
|
||||||
DC_EXEC | DC_NO_TOWN_RATING
|
DC_EXEC | DC_NO_TOWN_RATING
|
||||||
);
|
);
|
||||||
assert(!CmdFailed(r));
|
|
||||||
}
|
}
|
||||||
} while (++aib, --j);
|
} while (++aib, --j);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue