diff options
author | pasky <pasky@openttd.org> | 2005-03-27 00:28:14 +0000 |
---|---|---|
committer | pasky <pasky@openttd.org> | 2005-03-27 00:28:14 +0000 |
commit | 0c5d61bd56cb8ec4c2caa8aadb9c397c6931b544 (patch) | |
tree | fa4b74ffb1e7fe3ea3fcd1105aa17c0490f7a41c /players.c | |
parent | e416fe8066a4f959212391333ca4dbec1595e007 (diff) | |
download | openttd-0c5d61bd56cb8ec4c2caa8aadb9c397c6931b544.tar.xz |
(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.
Diffstat (limited to 'players.c')
-rw-r--r-- | players.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -974,7 +974,8 @@ static const byte _player_economy_desc[] = { static const byte _player_ai_desc[] = { SLE_VAR(PlayerAI,state, SLE_UINT8), SLE_VAR(PlayerAI,tick, SLE_UINT8), - SLE_VAR(PlayerAI,state_counter, SLE_UINT16), + SLE_CONDVAR(PlayerAI,state_counter, SLE_FILE_U16 | SLE_VAR_U32, 0, 12), + SLE_CONDVAR(PlayerAI,state_counter, SLE_UINT32, 13, 255), SLE_VAR(PlayerAI,timeout_counter, SLE_UINT16), SLE_VAR(PlayerAI,state_mode, SLE_UINT8), |