Chunnel: Use hash table for tunnel search, change tunnel fields and savegame format.

This commit is contained in:
Jonathan G Rennison
2017-03-05 14:32:17 +00:00
parent ad15b47f72
commit 89a0a9c182
5 changed files with 54 additions and 27 deletions

View File

@@ -2046,7 +2046,7 @@ bool AfterLoadGame()
return false;
}
const Tunnel *t = new Tunnel(start_tile, end_tile, false);
const Tunnel *t = new Tunnel(start_tile, end_tile, TileHeight(start_tile), false);
SetTunnelIndex(start_tile, t->index);
SetTunnelIndex(end_tile, t->index);
@@ -2055,7 +2055,6 @@ bool AfterLoadGame()
}
}
/* Move the signal variant back up one bit for PBS. We don't convert the old PBS
* format here, as an old layout wouldn't work properly anyway. To be safe, we
* clear any possible PBS reservations as well. */

View File

@@ -20,6 +20,7 @@
static const SaveLoad _tunnel_desc[] = {
SLE_CONDVAR(Tunnel, tile_n, SLE_UINT32, 0, SL_MAX_VERSION),
SLE_CONDVAR(Tunnel, tile_s, SLE_UINT32, 0, SL_MAX_VERSION),
SLE_CONDVAR(Tunnel, height, SLE_UINT8, 0, SL_MAX_VERSION),
SLE_CONDVAR(Tunnel, is_chunnel, SLE_BOOL, 0, SL_MAX_VERSION),
SLE_END()
};